LinuxQuestions.org
Visit Jeremy's Blog.
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 11-21-2010, 07: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 07:33 AM.
 
Old 11-21-2010, 10:47 AM   #2
DaRkBoDoM
Member
 
Registered: Oct 2007
Location: Italy
Distribution: Ubuntu
Posts: 84

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

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

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

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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-21-2010 at 11:08 PM.
 
Old 11-24-2010, 09: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



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 05:14 AM
IPTables How to make outgoing traffic show from a different IP address codenjanod Linux - Networking 4 11-05-2009 01:10 PM
Route all HTTP traffic through wired interface on workstation jvolkman Linux - Networking 5 11-29-2006 08:51 PM
Iptables - Redirecting Outgoing Traffic Frankablu Linux - Networking 1 06-12-2005 01:18 PM
Route all traffic of a given type to an interface tsweatt Linux - Networking 0 09-01-2003 12:24 PM

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

All times are GMT -5. The time now is 06:28 PM.

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