One Bad Pixel
Better than The Nullset. =D

Forwarding PPTP through DDWRT using iptables

I had a scenario where I needed to forward PPTP through my DDWRT box so that it could connect to the Windows server remote access. This seems like it would be trivial port mapping, but PPTP relies on GRE (protocol 47) as well. Here is what I did to make it work…

#Forward PPTP and GRE to server
iptables -t nat -I PREROUTING -p tcp -d $(nvram get wan_ipaddr) --dport 1723 -j DNAT --to $pptpsvr:1723
iptables -t nat -I PREROUTING -p gre -d $(nvram get wan_ipaddr) -j DNAT --to $pptpsvr
iptables -I FORWARD -p tcp --dport 1723 -d $pptpsvr -j logaccept
iptables -I FORWARD -p gre -d $pptpsvr -j logaccept

Leave a comment!