LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-20-2009, 10:51 AM   #1
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 492

Rep: Reputation: 31
Question How does multihop choose it's route?


I was about to ask "how do I verify it works", but figured it out as I was typing the question:

Code:
ip route
192.168.50.0/24 dev ovirtbr0  proto kernel  scope link  src 192.168.50.1 
172.29.0.0/24 dev eth0  proto kernel  scope link  src 172.29.0.83  metric 1 
172.29.0.0/24 dev wlan0  proto kernel  scope link  src 172.29.0.84  metric 2 
192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1 
default 
	nexthop via 172.29.0.2  dev eth0 weight 1
	nexthop via 172.29.0.2  dev wlan0 weight 1

ping -c 5 www.google.ca; route -Cn | grep -e Source -e 74.125.95
PING www.l.google.com (74.125.95.99) 56(84) bytes of data.
64 bytes from iw-in-f99.google.com (74.125.95.99): icmp_seq=1 ttl=245 time=48.2 ms
64 bytes from iw-in-f99.google.com (74.125.95.99): icmp_seq=2 ttl=245 time=63.3 ms
64 bytes from iw-in-f99.google.com (74.125.95.99): icmp_seq=3 ttl=245 time=45.7 ms
64 bytes from iw-in-f99.google.com (74.125.95.99): icmp_seq=4 ttl=245 time=50.9 ms
64 bytes from iw-in-f99.google.com (74.125.95.99): icmp_seq=5 ttl=245 time=47.8 ms

--- www.l.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4052ms
rtt min/avg/max/mdev = 45.785/51.228/63.327/6.266 ms
Source          Destination     Gateway         Flags Metric Ref    Use Iface
172.29.0.83     74.125.95.104   172.29.0.2            0      0        5 eth0
172.29.0.84     74.125.95.99    172.29.0.2            0      0        5 wlan0
74.125.95.104   172.29.0.83     172.29.0.83     l     0      0        4 lo
74.125.95.147   172.29.0.83     172.29.0.83     l     0      0        1 lo
172.29.0.84     74.125.95.99    172.29.0.2            0      0        0 eth0
172.29.0.83     74.125.95.147   172.29.0.2            0      0        2 eth0
172.29.0.83     74.125.95.147   172.29.0.2            0      0        0 wlan0
172.29.0.83     74.125.95.104   172.29.0.2            0      0        0 wlan0
74.125.95.99    172.29.0.84     172.29.0.84     l     0      0        4 lo
So now my question how does it choose the route? Is it simply a case of which interface responds first? Which theoretically would be the interface which has the least amount of traffic?
 
Old 02-20-2009, 11:00 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
In general the route chosen is the most specific route with the lowest metric. so a route x/24 metric 10 would chosen over x/24 metric 20, and one to y/28 metric 10 would be chosen over y/24 metric 10.
 
  


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 04:09 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