how to Port Forward

Alexander Dalloz ad+lists at uni-x.org
Thu Jun 9 14:43:58 UTC 2005


Am Do, den 09.06.2005 schrieb Shahzad Chohan um 16:32:

> Basically I tried the NAT command but it wouldn't work, I think the
> destination server 192.168.1.2 is talking back to the client directly
> as opposed to going back to the 192.168.1.1 originating server then to
> the client.

Yes, sorry, I missed the SNAT part in my first reply.

> Shaz

iptables -A PREROUTING -t nat -d 192.168.1.1 -p tcp --dport 22 -j DNAT
--to 192.168.1.2:22
iptables -A POSTROUTING -t nat -s 192.168.1.2 -p tcp --dport 22 -j
SNAT --to 192.168.1.1:22

These are the 2 rules necessary on the NATing host.

Alexander


-- 
Alexander Dalloz | Enger, Germany | GPG http://pgp.mit.edu 0xB366A773
legal statement: http://www.uni-x.org/legal.html
Fedora Core 2 GNU/Linux on Athlon with kernel 2.6.11-1.27_FC2smp 
Serendipity 16:39:36 up 16 days, 15:17, load average: 0.12, 0.12, 0.09 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20050609/be56f4b6/attachment-0002.bin 


More information about the users mailing list