Networking Forums

Networking Forums > Computer Networking > Linux Networking > Selective SNAT using IPtables?

Reply
Thread Tools Display Modes

Selective SNAT using IPtables?

 
 
Justin Todd
Guest
Posts: n/a

 
      12-15-2005, 08:00 PM
I have a machine with 2 interfaces:

MachineX:
- eth0 192.168.9.2
- eth1 192.168.10.1

When I Ping 192.168.9.??? from MachineX, I want the reciever to believe
that the packet originated from 192.168.10.1, instead of .9.2.

However, if I forward a packet from eth1 to eth0 (say SRC: 192.168.10.99
DST: 192.168.9.222), I dont want any packet mangling to occur.

Is it possible to just SNAT packets originating from our local machine?

Regards,

Justin
 
Reply With Quote
 
 
 
 
Robert
Guest
Posts: n/a

 
      12-16-2005, 03:21 AM
On Thu, 15 Dec 2005 21:00:57 +0000, Justin Todd wrote:

> I have a machine with 2 interfaces:
>
> MachineX:
> - eth0 192.168.9.2
> - eth1 192.168.10.1
>
> When I Ping 192.168.9.??? from MachineX, I want the reciever to believe
> that the packet originated from 192.168.10.1, instead of .9.2.


Do you want all packet coming from .9.x to look like they are coming from
..10.1 or just pings?

> However, if I forward a packet from eth1 to eth0 (say SRC: 192.168.10.99
> DST: 192.168.9.222), I dont want any packet mangling to occur.
>
> Is it possible to just SNAT packets originating from our local machine?


I'm thinking Mangle but I need to know the above first.


--

Regards
Robert

Smile... it increases your face value!


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
 
Reply With Quote
 
prg
Guest
Posts: n/a

 
      12-16-2005, 04:36 AM


Justin Todd wrote:
> I have a machine with 2 interfaces:
>
> MachineX:
> - eth0 192.168.9.2
> - eth1 192.168.10.1
>
> When I Ping 192.168.9.??? from MachineX, I want the reciever to believe
> that the packet originated from 192.168.10.1, instead of .9.2.


Well, just for the purpose of ping, try the -I (that's "eye") option.
For traceroute, you can use -i or -s. Look at the man pages for
details.

> However, if I forward a packet from eth1 to eth0 (say SRC: 192.168.10.99
> DST: 192.168.9.222), I dont want any packet mangling to occur.
>
> Is it possible to just SNAT packets originating from our local machine?


It's not clear (entirely) what you want. You mean _all_ packets
originating from the local MachineX should have "what address"? You
don't say. It more usual to have a router NAT private IPs into a
public IP space, ie., the public IP of the NATing router.

It is possible but how you go about it will depend on what you are
trying to accomplish. No need to pull out the Abrams tank if a pea
shooter will do. Does this box have a default route? What's the
netmask of the networks? How will these packets get back to their
source (MachineX)? What is its function in the network? Is MachineX
offering any services or acting just as a router/firewall? Is this a
"border router"? Give us some idea what the goal is and the network
context.

Any help? :-)
prg

 
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
iptables: fake ip using DNAT and SNAT =?ISO-8859-1?Q?Bj=F8rnar_Lib=E6k?= Linux Networking 19 04-08-2006 12:08 AM
iptables SNAT and DNAT on same packets chris-usenet@roaima.co.uk Linux Networking 6 07-08-2005 09:19 AM
iptables/SNAT not working Steffen Koepf Linux Networking 2 02-03-2005 11:26 AM
iptables firewall/SNAT Cronus Linux Networking 2 12-13-2003 03:44 AM
iptables SNAT question (+) Den Linux Networking 0 10-28-2003 09:49 AM



1 2 3 4 5 6 7 8 9 10 11