LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 02-01-2008, 02:17 PM   #1
spank
Member
 
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?
Code:
iptables -t mangle -A PREROUTING -s X -j SAME --to Y
Please help!

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

Rep: Reputation: 168Reputation: 168
If you want to change the source address of packets leaving your box, you can use the POSTROUTING table. For example, with masquerading:
Code:
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
Does the definition at http://www.netfilter.org/documentati...T-HOWTO-3.html describe what you're trying to do? If so the howto should be useful.
 
  


Reply



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

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

All times are GMT -5. The time now is 07:47 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