Day 3 of my crash course in Linux firewalls.
The good news - I've got it working. I like it. It port forwards. Wee.
The bad news - PPTP is beating me down.
Ideally, I'd like to port forward VPN (1723 + GRE) connections to my Win2K VPN server on the back network. I haven't been able to get this working. I tried the following (with and without the FORWARD rules) - I noticed that I would see a message about the VPN-1723 when I tried a VPN connection from the outside world, but I never saw the GRE rule fire (not sure if it is even supposed to) -- end result is that it just wouldn't work.
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 1723 -j LOG --log-prefix "VPN-1723: "
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 1723 -j DNAT --to 10.0.0.51
iptables -A FORWARD -i eth1 -o eth0 -p 47 -d 10.0.0.51 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p 47 -j LOG --log-prefix "VPN-GRE: "
iptables -t nat -A PREROUTING -i eth1 -p 47 -j DNAT --to 10.0.0.51
iptables -A FORWARD -i eth1 -o eth0 -p TCP -d 10.0.0.51 --dport 1723 -j ACCEPT
I dug around and found this:
http://www.impsec.org/linux/masquerade/ip_masq_vpn.html
It said:
>Server masquerade for PPTP also works with the default >masquerade code. Add the following rules:
>
>PPTP (1723/tcp and 47/ip):
>
>/sbin/iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 1723 -
>j DNAT --to 192.168.0.5
>/sbin/iptables -t nat -A PREROUTING -i eth1 -p 47 -j DNAT --to
>192.168.0.5
>
>...where 192.168.0.5 is the local-network IP address of the PPTP
>server. I have not had any reports regarding IPsec server
>masquerade.
>
>Masquerading multiple clients talking to the same remote
>gateway will require protocol-specific support in the form of
>kernel patches, which are not yet available. Sorry.
I'm not sure exactly how to interpret this, but I assume that it means my SOL?...
Any help on getting the port forwarding to work would be super appreciated.
In the meantime, I've been trying to figure out how to get PPTPD to work and support MS style PPTP connections (i.e. CHAP.. etc)...
*RANT*
I know that the Linux/Unix world isn't full of MS lovers.. etc, but you'd think that people would be building in support for the largest installed based of desktops by default. I'm still struggling with applying the kernel/PPP/pptpd patches/configurations to get this all working (kernel recompile # I've lost count running right now)..
Thanks again for all the help!!!