Skip to contentSkip to conversation

SNAT not working

DISCUSSION Felipe 2 participants 2 messages Feb 29, 2004

lore
Share & tools
lore

Felipe

author
#0 lore raw

I've tried to set up SNAT to match INTERNAL network to a external ip,

/usr/local/sbin/iptables -t nat -A POSTROUTING -o eth0 -s 10.0.0.0/16 -j SNAT --to-source 200.110.2.179

But that's working, it only works when i put:

/usr/local/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

eth0= external interface
eth1= internal interface

i've linux 7.3 kernel 2.6.3 andiptables v1.2.9

Could you help me please?

Thanks

#1 lore raw
Quoted 11 lines · Felipe

I've tried to set up SNAT to match INTERNAL network to a external ip,

/usr/local/sbin/iptables -t nat -A POSTROUTING -o eth0 -s 10.0.0.0/16 -j SNAT --to-source 200.110.2.179

But that's working, it only works when i put:

/usr/local/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

eth0= external interface
eth1= internal interface

Is 200.110.2.179 the address of the external interface eth0?

If it isn't, then reply packets have no interface to come back to, so connections won't work.

Regards,

Antony.

Signature · 7 lines
"The joy of X!!??  I've always hated compiling graphical shite.  You have a 10 
line program, and it ends up depending on the entire known universe."

 - Philip Hands

                                                     Please reply to the list;
                                                           please don't CC me.