Networking Forums

Networking Forums > Computer Networking > Linux Networking > how to set SNAT?

Reply
Thread Tools Display Modes

how to set SNAT?

 
 
cranium.2003@gmail.com
Guest
Posts: n/a

 
      05-09-2005, 02:51 PM
hello,
I have 2 Routers in 4 computer LAN and setup 3 networks among them and
when i ping from HostA to HostB through Router1 and Router2,Router1 has
to SNAT and it did and sends a ping to HostB with HostB receiving src
ip of ping packet as that Router1 but reverse pong packet from HostB to
HostA does not changes src ip at Router2. why?
I added following to iptables
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
on both Routers as both have eth0 directly connected.
My configuration is
HostA
eth0=> 192.168.1.100

Router1
eth0=>10.1.1.1
eth1=>192.168.1.1

Router2
eth0=>10.1.1.100
eth1=>172.16.1.1

HostB
eth0=>172.16.1.100

What i observe that ping from HostA(192.168.1.100) to
HostB(172.16.1.100) goes to Router1 which does Snat and change src ip
from 192.168.1.100 to 10.1.1.1 and same will appear on Router2 to
HostB.
Then Pong(response) packet has srcip 172.16.1.100 and dst
192.168.1.100 as its not changed but same packet appear on
Router2->Router1->HostA

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to snat merrittr Linux Networking 0 10-17-2007 08:59 PM
Where the de-SNAT actually takes place? mati-006 Linux Networking 0 08-19-2006 03:58 PM
Racoon with SNAT Can2002 Linux Networking 1 08-10-2005 05:25 PM
SNAT Kevin Brown Linux Networking 1 07-06-2005 09:30 PM
bridging fw and snat Wolfgang Kohnen Linux Networking 1 06-20-2005 06:31 PM



1 2 3 4 5 6 7 8 9 10 11