LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 11-21-2010, 08:32 AM   #1
predatorz
Member
 
Registered: Mar 2007
Posts: 58

Rep: Reputation: 15
IPtables: Route outgoing traffic from internal host to only go a internet interface


Hi,

My Ubuntu Box has 3 interfaces.
eth0 (Internal 192.168.1.0/24)
eth1 (External ISP DHCP)
eth2 (External ISP Static IP)
I need the outgoing traffic to internet for 1 of the internal pc (192.168.1.10) to only go only go through eth2.

How do i write using iptables to do the above?
Thanks.

Last edited by predatorz; 11-21-2010 at 08:33 AM.
 
Old 11-21-2010, 11:47 AM   #2
DaRkBoDoM
Member
 
Registered: Oct 2007
Location: Italy
Distribution: Ubuntu
Posts: 73

Rep: Reputation: 17
It's a routing issue, not a firewall issue.

Check google for iproute2 and "source routing"
 
Old 11-21-2010, 11:13 PM   #3
predatorz
Member
 
Registered: Mar 2007
Posts: 58

Original Poster
Rep: Reputation: 15
Okay thanks.
 
Old 11-21-2010, 11:38 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Look at Section 4.1 Simple Source Routing for an example:

http://www.linuxdocs.org/HOWTOs/Adv-...g-HOWTO-4.html

An updated version of this document may have been supplied with the iproute2 package:
file:///usr/share/doc/howto/en/html/Adv-Routing-HOWTO/index.html

Last edited by jschiwal; 11-22-2010 at 12:08 AM.
 
Old 11-24-2010, 10:05 AM   #5
predatorz
Member
 
Registered: Mar 2007
Posts: 58

Original Poster
Rep: Reputation: 15
Thanks for the help, i managed to get it working nicely.
 
  


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
[SOLVED] How do I route traffic from a single host through a specific interface? sab0teur Linux - Networking 3 07-23-2014 06:14 AM
IPTables How to make outgoing traffic show from a different IP address codenjanod Linux - Networking 4 11-05-2009 02:10 PM
Route all HTTP traffic through wired interface on workstation jvolkman Linux - Networking 5 11-29-2006 09:51 PM
Iptables - Redirecting Outgoing Traffic Frankablu Linux - Networking 1 06-12-2005 02:18 PM
Route all traffic of a given type to an interface tsweatt Linux - Networking 0 09-01-2003 01:24 PM


All times are GMT -5. The time now is 01:59 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration