[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Port forwarding with iptables + nat.



Hi,

Ok, after some more fiddling, iptables is not working. 
I'd accidentally used the internet ip of the linux gateway, silly me :/
(How to make an ass of ones self ;P)

Ok, the setup.
This box has the external ip 196.14.166.226. 
My workstation is 196.14.166.22.
All the traffic except stuff going to 196.14.166.0/27 goes
out through a pptp-VPN. 

I've taken the VPN down in the mean time to try get this working... 
Still no luck. 

Configuration.
#Enable forwarding in kernel
echo 1 > /proc/sys/net/ipv4/ip_forward
#Kill timestamps
echo 0 > /proc/sys/net/ipv4/tcp_timestamps
#Enable SYN Cookies
echo 1 > /proc/sys/net/ipv4/tcp_syncookies

The computer connects to use through a tie-line, 56kb.


iptables -t nat -A PREROUTING -i ppp0 -p tcp -d 196.14.166.226 --dport 25 -j DNAT --to 192.168.0.50:25

is what I'm trying to use... 
Now, I need to be able to use 196.14.166.22 to connect to port 25 and then
that'll port forward to 192.168.0.50:25. 

It just isn't working, I've tried things with SNAT, DNAT, -A FORWARD.
I am not winning here folks.

Please help, thanks in advance. 

-- 
William Fletcher (ultraviolet)		   
IT Administrator, EPWeb networks.	                 
http://www.epweb.co.za/				       
Tel: +27 (041) 395 6800				  
Fax: +27 (041) 395 6818 
Support: support@epweb.co.za

Attachment: pgp5pfBWEaXSM.pgp
Description: PGP signature


Reply to: