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

Re: need iptables port forwarding help!



Tom Vier wrote:

i've tried several times, using multiple different rules i've found from
different sites, and i still can't get port forwarding working. does anyone
have working rules they could send me? i'm trying to forward packets from my
isp to port 2222 to an internal ip (i use nat) and port 22.

any help is much appreciated! this has been driving me crazy. 8)

There's this rather cute rules I dreamed up August last year when I wanted to transparently direct traffic headed to RH to a site on my LAN: iptables -t nat --src 192.168.0.116 --destination ftp.redhat.com -A PREROUTING -i eth1 --protocol tcp --dport 80 -j DNAT --to-destination 192.168.0.1

and these two to forward incoming VNC connexions:
iptables -t nat --src 203.59.48.1 -A PREROUTING -i ppp0 -p tcp --dport 5901 -j DNAT --to-destination 192.168.1.101 iptables -t nat --src 203.59.48.1 -A PREROUTING -i ppp0 -p tcp --dport 5801 -j DNAT --to-destination 192.168.1.101
I guess those are pretty much what you want.


--

Cheers
John

-- spambait
1aaaaaaa@computerdatasafe.com.au  Z1aaaaaaa@computerdatasafe.com.au
Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/



Reply to: