Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-01-2008, 03:17 PM   #1
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Rep: Reputation: 30
Mangle ip source with iptables

Can I modify packets that leave my station using iptables to have a different source address ?

For example I have the ip X and I want the packets that leave the station having in the ip header the ip Y. I guess it has something to do with the mangle table of iptables but I`m not too good with that.

something like this maybe?
iptables -t mangle -A PREROUTING -s X -j SAME --to Y
Please help!

Last edited by spank; 02-01-2008 at 03:22 PM.
Old 02-02-2008, 01:34 AM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
If you want to change the source address of packets leaving your box, you can use the POSTROUTING table. For example, with masquerading:
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
Does the definition at describe what you're trying to do? If so the howto should be useful.


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
Mangle Table santhosh23 Linux - General 2 06-24-2007 09:52 PM
need info on mangle swapna_gg83 Linux - Networking 3 05-03-2006 01:34 AM
iptables mangle problem posixjunkie Linux - Networking 1 04-25-2006 11:17 AM
LXer: Spam Filters Mangle Christmas Cards LXer Syndicated Linux News 0 12-09-2005 09:46 PM
Filtering in iptables mangle? MarleyGPN Linux - Networking 1 07-08-2005 02:54 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:24 AM.

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