LinuxQuestions.org
Help answer threads with 0 replies.
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 03-26-2007, 09:19 AM   #1
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 32
Multiple gateways, one interface


I have two gateways behind one switch, one cable coming to me. I want to make Linux use both of the gateways equaly.
I'm trying to follow the steps in http://lartc.org/howto/lartc.rpdb.multiple-links.html
The problem is sometimes RTNETLINK gives me trouble answers, like "Invalid argument" or "File exist". I have solved some of these 'invalid arguments' by adding several items into the kernel configure.
However now I got "File exist". Which file ?! Why these error messages are so cryptic...
Here is the situation:
Code:
# ifconfig eth0 192.168.0.250 netmask 255.255.255.0 up
# ifconfig eth0:0 10.10.10.2 netmask 255.255.255.0 up
(1)# route del -net 192.168.0.0/24
(1)# route del -net 10.10.10.0/24  

# ip route add 192.168.0.0/24 dev eth0 table 200
(3)# ip route add default via 192.168.0.1 dev eth0 table 200
# ip route add 10.10.10.0/24 dev eth0:0 table 100
# ip route add default via 10.10.10.1 dev eth0:0 table 100
(2)RTNETLINK answers: File exists
# ip route add 192.168.0.0/24 src 192.168.0.1 dev eth0
(4)RTNETLINK answers: Invalid argument
# ip route add 10.10.10.0/24 src 10.10.10.1 dev eth0:0
(5)RTNETLINK answers: Invalid argument
(6)# ip route add 10.10.10.0/24 src 10.10.10.1 dev eth0
RTNETLINK answers: Invalid argument
(7)# ip route add default scope global nexthop via 10.10.10.1 weight 1 nexthop via 192.168.0.1 weight 1 
RTNETLINK answers: Invalid argument
-------------------------------------
(8)# route del default gw 192.168.0.1
# ip route add default scope global nexthop via 10.10.10.1 weight 1 nexthop via 192.168.0.1 weight 1
Some explanations:
(1) - When I add an IP address to my NIC ifconfig automaticaly adds a network for that IP. I delete these networks to add them lately acording to the LARTC example.
(2) - What is existing? Maybe there is already a default route (gateway) selected in (3). However I'm able to add several default gateways trough `route add default gw XXX.XXX.XXX.XXX`
(4),(5) - What exactly is invalid?
(6) - Maybe it doesn't accept IP aliases in `ip` command line? I tried without the alias, only eth0 but it is still invalid.
(7) - It is my goal this to work - however another invalid argument.
(8) - When deleting the current default gw (I believe the command (3) added it) I'm able to make it load witouth error. However this is the output from `route -n`. I'm not sure if the result from this is to be marked here:
Code:
 Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
10.10.10.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
I'm not sure if I'm doing something wrong, or my kernel is lacking something (again). Give me any idea how to proceed.
 
Old 03-27-2007, 05:59 PM   #2
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
Hmm, I am trying to understand what you are getting at ...

You have two ethernet interfaces.

You are trying to add two default gateways ?

or are you trying to add multiple routes to different distinct networks routed through different ethernet interfaces??
 
Old 03-28-2007, 12:14 PM   #3
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Original Poster
Rep: Reputation: 32
I have one network interface.
I'm trying to add two default gateways trough wich I can connect to internet. In order to increase my bandwidth.
 
Old 04-02-2007, 12:21 AM   #4
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Original Poster
Rep: Reputation: 32
Idea, anyone?
 
  


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
Multiple Gateways Jon Doe Linux - Networking 9 03-07-2005 03:26 PM
Multiple Gateways inforlinx Linux - Networking 1 02-22-2005 08:28 PM
Red Hat 7.3 and multiple gateways on multiple interfaces bluefmc Linux - Networking 2 11-19-2004 05:01 PM
multiple gateways john8675309 Linux - Software 0 05-24-2004 06:27 PM
multiple ips, multiple gateways, one interface drpixel Linux - Networking 6 12-04-2002 12:56 AM

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

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