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 05-06-2008, 01:34 PM   #1
xanax
Member
 
Registered: Mar 2006
Distribution: Debian
Posts: 34

Rep: Reputation: 15
Ip route


Ok i have 3 ethernet card eth0,eth2 and eth2. Eth0 is a lan card and eth1 and eth2 are cards with internet access. I managed to set routing per nat user to route them whatever i like. The question is how to set a routing rule only for the router itself to route thru table dsl2 ??
iplan - lan ip
ip1 - dsl1 ip
ip2 -dsl2 ip
I tried:
ip rule add from ip1 table dsl1

I know i can set default gateway in main table but i want everybody to go the default gw and set the router to thru different gw. Can enybody help me ??
 
Old 05-07-2008, 07:30 AM   #2
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
If the default gw is not the dsl1 then all packets will leave the machine via the interface that connects to the default gw.

To make your router go through the dsl1 you can use iptables to mark packets generated by the router then use a fwmark rule to push the traffic to dsl1

Code:
iptables -t mangle -I OUTPUT -j MARK --set-mark 2
ip ru add fwmark lookup dsl1
 
  


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
iproute2 (ip route), pppoe and default route lorddoskias Linux - Networking 0 05-09-2007 11:04 AM
Default route took 20s to display with 'route' command Akhran Linux - Newbie 3 11-04-2006 04:59 AM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
ADSL as a Alternate route or backup route bhagat2000 Linux - Networking 0 05-27-2004 03:17 PM
Working with 'route' and unwanted route entries pioniere Linux - Networking 6 02-05-2003 12:14 PM

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

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