cancel
Showing results for 
Search instead for 
Did you mean: 

Port Forward

 
Highlighted
Valued Contributor

Port Forward

Hi all,
i have a problem with port forward.
I' ve three linux box:
Gateway, Proxy and Server.

My network is 172.20.0.0
Gateway has ip 172.20.0.1 and 192.168.0.1
Proxy 192.168.0.2
Server 192.168.0.3

On Gateway there is
$IPTABLES -t nat -A PREROUTING -i $ETH_LAN -p udp -s 172.20.0.0/16 --dport 161 -j DNAT --to-destination 192.168.0.2

On Proxy
iptables -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.2 --dport 161 -j DNAT --to-destination 192.168.0.3

Default Gw of Proxy and Server is Gateway

From my client on 172.20.0.0 LAN i can't query snmp thee Server, why?
Thanks
3 REPLIES 3
Highlighted
Honored Contributor

Re: Port Forward

You have your SNAT rules for the packets going the other direction?
One long-haired git at your service...
Highlighted
Exalted Contributor

Re: Port Forward

Shalom,

Need to see the entier iptables configuration. Not your block lists but configuration.

I hate iptables and use http://www.fs-security.com Firestarter wherever possible.

For diagnosis, turn on logging.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Highlighted
Honored Contributor

Re: Port Forward

Why you set "-p udp" on gateway and "-p tcp" on Proxy? Put udp if you want to use port 161.


See also

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables
So computers don't think yet. At least not chess computers. - Seymour Cray