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 02-11-2009, 01:26 AM   #1
sarthor
LQ Newbie
 
Registered: Apr 2005
Posts: 10

Rep: Reputation: 1
Routing for Multiple uplinks / providers


according to the under mentioned url i did all but still problem in routing 2 isps on same linux router,
http://lartc.org/howto/lartc.rpdb.multiple-links.html


Using Ubunut hardy 8.04 server i386
My /etc/network/interfaces
Quote:

---------------------
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
# gateway 192.168.1.1
auto eth2
iface eth2 inet static
address 192.168.2.2
netmask 255.255.255.0
network 192.168.2.0
# gateway 192.168.2.1

auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
-------------------------
According to http://lartc.org/howto/lartc.rpdb.multiple-links.html
Quote:


#!/bin/sh

## Creating Routing Tables
ip route add 192.168.1.0 dev eth1 src 192.168.1.2 table 1
ip route add default via 192.168.1.1 table 1
ip route add 192.168.2.0 dev eth2 src 192.168.2.2 table 2
ip route add default via 192.168.2.1 table 2
#=====
ip route add 192.168.1.1 dev eth1 src 192.168.1.2
ip route add 192.168.2.1 dev eth2 src 192.168.2.2
# default route
ip route add default via 192.168.1.1
# Adding Rules
ip rule add from 192.168.1.2 table 1
ip rule add from 192.168.2.2 table 2
# Adding according to Rod roard Note
ip route add 192.168.0.0 dev eth0 table 1
ip route add 192.168.2.0 dev eth2 table 1
ip route add 127.0.0.0/8 dev lo table 1

ip route add 192.168.0.0 dev eth0 table 2
ip route add 192.168.1.0 dev eth1 table 2
ip route add 127.0.0.0/8 dev lo table 2

ip route add default scope global nexthop via 192.168.1.1 dev eth1 weight 1 nexthop via 192.168.2.1 dev eth2 weight 1
-------------------------------
My routes
Quote:
route -n

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
192.168.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth2
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
root@playzone:~#
---------------------------------------
on my linux Router i can browse (using elinks)and surf internet with gateway 192.168.1.1 but when i unpluge the 192.168.1.1 then 192.168.2.1 is not working,
in elinks browser i open ubuntu.com its says "Unable to retrive http://ubuntu.com/: No route to host"


also i disable the line "
ip route add default via 192.168.1.1" but still some pages are opening and some not,
my linux routuer can ping each gateway,
any help??
there was old thread about multiple routing on linuxpakistan.net forum and i searched that but i was not lucky
 
Old 02-11-2009, 01:38 AM   #2
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
That could be because of IP_ROUTE_MULTIPATH_CACHED and dead gateway detection not working on your system. You may need to patch your kernel details can be found here.

http://www.ssi.bg/~ja/
 
Old 02-11-2009, 09:16 AM   #3
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
hi sarthor,

it seems that this is the problem :
Code:
route -n

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
192.168.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth2
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
root@playzone:~#
triggered by this script :
Code:
# default route
ip route add default via 192.168.1.1
you only have 1 default gateway to the internet = eth1.
just create another 1 for the second NIC eth2

#ip route add default via 192.168.2.1

HTH.
 
Old 02-11-2009, 10:59 AM   #4
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
That may not be entirely the case, the old route utility is incapable of displaying multipathed routes the right utility to check that would be

Code:
ip ro sh
 
Old 02-11-2009, 06:26 PM   #5
sarthor
LQ Newbie
 
Registered: Apr 2005
Posts: 10

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by rossonieri#1 View Post
hi sarthor,

it seems that this is the problem :
Code:
route -n

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
192.168.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth2
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1
root@playzone:~#
triggered by this script :
Code:
# default route
ip route add default via 192.168.1.1
you only have 1 default gateway to the internet = eth1.
just create another 1 for the second NIC eth2

#ip route add default via 192.168.2.1

HTH.
HI
Result of
#ip route add default via 192.168.2.1
Quote:
root@playzone:~# ip route add default via 192.168.2.1
RTNETLINK answers: File exists
Dear datopdog
your given code result is here

#ip ro sh

Quote:
root@playzone:~# ip ro sh
192.168.1.1 dev eth1 scope link src 192.168.1.2
192.168.2.1 dev eth2 scope link src 192.168.2.2
192.168.2.0/24 dev eth2 proto kernel scope link src 192.168.2.2
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.2
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.1
default
nexthop via 192.168.1.1 dev eth1 weight 1
nexthop via 192.168.2.1 dev eth2 weight 1
root@playzone:~#
still hoping for the solution on linux, not hardware
 
Old 02-13-2009, 12:11 PM   #6
sarthor
LQ Newbie
 
Registered: Apr 2005
Posts: 10

Original Poster
Rep: Reputation: 1
Still waiting for reply!!
 
Old 02-23-2009, 09:00 AM   #7
sarthor
LQ Newbie
 
Registered: Apr 2005
Posts: 10

Original Poster
Rep: Reputation: 1
Hi
i tried the script here but same, some website are opening and some are not, aslo messnegers are not working
..
While i saw the Windows maching that working fine with 2 isps, i plugged/unpluged each isp, and thta was fine, but the guy didnt allowed me to view the configurations of that machine.

Solution on LInux??
Waiting.....

Last edited by sarthor; 02-23-2009 at 09:03 AM.
 
  


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 providers dedexes Linux - Networking 1 02-08-2009 11:24 AM
multiple providers fritz001 Linux - Networking 3 09-17-2008 04:57 PM
Possible to setup multiple uplinks with 3G usb modem? Niceman2005 Linux - Networking 0 06-05-2008 08:13 PM
Iptables and multiple uplinks reggie Linux - Networking 3 12-09-2007 02:51 PM
multiple uplinks posixjunkie Linux - Networking 1 04-25-2006 01:16 PM

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

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