LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-25-2004, 05:23 PM   #1
VanMuur
LQ Newbie
 
Registered: Sep 2004
Posts: 1

Rep: Reputation: 0
One hop source address change


I have a really weird question, but before I ask it, I can tell you that I know the answer is *NOT* SNAT. My issue is that its *close* to SNAT, but in actuality, its something a little more specific than that. What I want to do is have a packet gain an IP address of another interface for that particular hop only (I.E, it doesn't change the source address for ALL packets, just the packet forwarded through that system). If I have system 'B' with two interfaces, acting as a router, I want all packets going out port 2 (lets call it eth1) to have the address of port 1 (lets call that eth0). Normally, with SNAT, you would do: "iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to <address of eth1>". Unfourtunately, this changes the source address of every packet going out of eth1, not just the particular hop. The reason for the bizarre request is that I have a ppp bridge over vtun working between two machines, and whenever a packet goes over the bridge, it acquires the address of the bridge. Normally, this is OK, but further down the line, for the packet to reutrn, I would have to input the routes for both the network on the far end. Being a hassle, I found that if I change the address of the packet through system 'B', I only have to specify one route, and the packet returns just as easily. Does anyone know how to do this with iptables? All I can find is SNAT'ing, and that really mangles the packet bad, when all I need is a one-hop change. Thanks in advance,

Ian
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Ip address luisator Linux - Newbie 3 06-02-2005 04:03 AM
problem to print source address and destination address jooboo Programming 2 11-26-2003 03:24 PM
outgoing source ip address ram_dhupkar Linux - Networking 1 08-26-2003 01:40 PM
cannot change ip address ??? aherrys Linux - Networking 0 07-06-2003 03:34 AM
Change address juno Linux - General 2 10-25-2002 03:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration