November 23, 2024, 05:02:21 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: MASQUERADE vs SNAT  (Read 6228 times)

Offline neilg_cebu

  • Linux Noob !
  • *
  • Posts: 16
MASQUERADE vs SNAT
« on: April 26, 2005, 02:34:36 AM »
Hi,

I have read some articles which says MASQUERADE is not the better option than SNAT.

Currently, I am using MASQUERADE and then I want to change it to SNAT.

I have here my current IP Rule:

iptables -t nat -A POSTROUTING -p ip 192.168.100.0/24 -d 0/0 -o eth0 -j MASQUERADE

this works fine. but I want to use SNAT instead of MASQUERADE.

I tried something like this:

iptables -t nat -A POSTROUTING -p tcp -o eth0 -j SNAT --to-source 192.168.100.226-192.168.100.254

this does not work somehow.

Kindly explain how to make SNAT works please...

My setup is like this:
eth0 - public IP
eth1 - private IP

all clients computers (winxp) connect to internet thru this computer (linux)

hope to have reply soon.

Thanks In Advance,
Neil

Offline neilg_cebu

  • Linux Noob !
  • *
  • Posts: 16
MASQUERADE vs SNAT
« Reply #1 on: May 31, 2005, 06:39:16 AM »
Hi,

It seems that this topic is a non-sense to everyone. Honestly, I am a novice to this OS (Linux) and I really want to have some enlightenment and guidance. I am confuse about the "NAT". Can someone here gives a clarification? Specially SNAT and DNAT. what is SNAT for? and what is DNAT for?

Is SNAT translating address going into the client computer or translating address going outside to the internet? how about DNAT? Please give me explanation.

I have here a quote below, this is relevant to my original post which nobody has replied.

"Masquerade - There is a specialized case of Source NAT called masquerading: it should only be used for dynamically-assigned IP addresses, such as standard dialups (for static IP addresses, use SNAT above). "

In my case, I am using static IP - thats why I am eager to have SNAT rather than Masquerade.

I hope this time, someone would reply.


TIA,
Neil

Offline neilg_cebu

  • Linux Noob !
  • *
  • Posts: 16
MASQUERADE vs SNAT
« Reply #2 on: June 01, 2005, 09:17:30 AM »
Hello All,

After self exploring a little bit, I finally found the solution and the correct syntax. It works fine now.

THanks,
Neil