Networking Forums

Networking Forums > Computer Networking > Linux Networking > SNAT

Reply
 
 
Kevin Brown
Guest
Posts: n/a

 
      07-06-2005, 08:03 PM
Hello all,

I have a network with a few public IP's on it and a few private IP's on
it. Up until now it has been completely private but we have recently
introduced some public IP addresses. Here's the setup

eth0 -> 192.168.3.1 (255.255.255.0)
200.101.4.1 (255.255.255.128)

ppp0 -> 200.101.5.100 (255.255.255.255)

(the IP's above are not actually mine, I'm sorry if they happen to be
yours ;-)

Anyways, if I have a machine that is hooked up to eth0 with an IP of
200.101.4.2, all the traffic from it becomes source NATed. Running a
"what's my IP" check on the net returns an address of 200.101.5.100
(ppp0's IP address).

How do I make iptables SNAT only on 192.168.3.0/24 and not on
200.101.4.0/25?

Thanks in advance,
Kevin Brown.
 
Reply With Quote
 
 
 
 
Alexander Clouter
Guest
Posts: n/a

 
      07-06-2005, 09:30 PM
On 2005-07-06, Kevin Brown <-NOSPAM-itismekevinb-NOSPAM-@hotmail.com> wrote:
> Hello all,
>
> I have a network with a few public IP's on it and a few private IP's on
> it. Up until now it has been completely private but we have recently
> introduced some public IP addresses. Here's the setup
>
> eth0 -> 192.168.3.1 (255.255.255.0)
> 200.101.4.1 (255.255.255.128)
>
> ppp0 -> 200.101.5.100 (255.255.255.255)
>
> (the IP's above are not actually mine, I'm sorry if they happen to be
> yours ;-)
>
> Anyways, if I have a machine that is hooked up to eth0 with an IP of
> 200.101.4.2, all the traffic from it becomes source NATed. Running a
> "what's my IP" check on the net returns an address of 200.101.5.100
> (ppp0's IP address).
>
> How do I make iptables SNAT only on 192.168.3.0/24 and not on
> 200.101.4.0/25?
>

iptables -t nat -I POSTROUTING \
-o ppp0 -s 192.168.3.1/24 -d ! 192.168.3.1/24 \
-j SNAT --to-source 200.101.5.100

Should do it Notice you specify more precisely what you want NAT'ed; I'm
guessing you have a 'catchall' SNAT rule in there

Cheers

Alex

> Thanks in advance,
> Kevin Brown.

 
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
bridging fw and snat Wolfgang Kohnen Linux Networking 1 06-20-2005 06:31 PM
how to set SNAT? cranium.2003@gmail.com Linux Networking 0 05-09-2005 02:51 PM



1 2 3 4 5 6 7 8 9 10 11