Networking Forums

Networking Forums > Computer Networking > Linux Networking > routing behaviour with two nics on same subnet

Reply
Thread Tools Display Modes

routing behaviour with two nics on same subnet

 
 
spip_yeah@yahoo.com
Guest
Posts: n/a

 
      11-08-2006, 08:55 PM
Hello,

Given a machine that has two NICs (eth0 and eth1), with both of them
being on the same network, with the same subnet mask, etc. What would
be the default routing behaviour is I, say, ping yahoo.com? Would it
go over eth0 or eth1?

 
Reply With Quote
 
 
 
 
Damian 'legion' Szuberski
Guest
Posts: n/a

 
      11-08-2006, 09:38 PM
On 2006-11-08, (E-Mail Removed) wrote:
> Given a machine that has two NICs (eth0 and eth1), with both of them
> being on the same network, with the same subnet mask, etc. What would
> be the default routing behaviour is I, say, ping yahoo.com? Would it
> go over eth0 or eth1?

To default gateway.

--
Damian Szuberski
 
Reply With Quote
 
spip_yeah@yahoo.com
Guest
Posts: n/a

 
      11-08-2006, 09:46 PM

> > Given a machine that has two NICs (eth0 and eth1), with both of them
> > being on the same network, with the same subnet mask, etc. What would
> > be the default routing behaviour is I, say, ping yahoo.com? Would it
> > go over eth0 or eth1?

> To default gateway.


To default gateway, but via which device?

Do you mean the default gateway specified below:

10.10.88.0/22 dev eth0 proto kernel scope link src 10.10.88.67
10.10.88.0/22 dev eth1 proto kernel scope link src 10.10.88.104
169.254.0.0/16 dev eth1 scope link
default via 10.10.88.1 dev eth0

Meaning that if a packet is candidate for both interfaces, then the
default rule is opted for, in this case resulting in the default
gateway being reached via eth0?

As an aside, what does this routing rule mean?

169.254.0.0/16 dev eth1 scope link

Thanks.

 
Reply With Quote
 
Pascal Hambourg
Guest
Posts: n/a

 
      11-09-2006, 08:38 AM
Hello,

(E-Mail Removed) a écrit :
>>>Given a machine that has two NICs (eth0 and eth1), with both of them
>>>being on the same network, with the same subnet mask, etc. What would
>>>be the default routing behaviour is I, say, ping yahoo.com? Would it
>>>go over eth0 or eth1?

>>
>>To default gateway.

>
> To default gateway, but via which device?


The device specified in the chosen best route for the destination. If
there are multiple best route with equivalent priority, I like to
consider that the chosen one among then is unpredictable.

> Do you mean the default gateway specified below:
>
> 10.10.88.0/22 dev eth0 proto kernel scope link src 10.10.88.67
> 10.10.88.0/22 dev eth1 proto kernel scope link src 10.10.88.104


Does yahoo.com (216.109.112.135 or 66.94.234.13) match 10.10.88.0/22 ?
No -> route not chosen.

> 169.254.0.0/16 dev eth1 scope link


Does yahoo.com (216.109.112.135 or 66.94.234.13) match 169.254.0.0/16 ?
No -> route not chosen.

> default via 10.10.88.1 dev eth0


Does yahoo.com (216.109.112.135 or 66.94.234.13) match 0/0 (default) ?
Yes -> route chosen, via device eth0.

> Meaning that if a packet is candidate for both interfaces, then the
> default rule is opted for, in this case resulting in the default
> gateway being reached via eth0?


No. See above. The default route is chosen when no other route matches.
Here, your box would face a dilemma when sending a packet to a
destination in 10.10.88.0/22, but not when sending to the default gateway.

> As an aside, what does this routing rule mean?
>
> 169.254.0.0/16 dev eth1 scope link


It's a link-local non routable block mainly used by zeronconf and the like.
 
Reply With Quote
 
spip_yeah@yahoo.com
Guest
Posts: n/a

 
      11-09-2006, 05:45 PM

Thank you for your answers.

Now, supposing that the two interfaces of linuxbox (I'll call it that)
were on seperate networks, for example 192.168.1.0/24 and
192.168.2.0/24, and that hosts on those two networks were configured to
rely on linuxbox as their gateway...

Would an incoming packet from host on the 192.168.1.0/24 network
destined for a host on 192.168.2.0/24 network automatically be
forwarded by linuxbox as long as /proc/sys/net/ip_forward is set to 1?

 
Reply With Quote
 
Pascal Hambourg
Guest
Posts: n/a

 
      11-12-2006, 08:49 PM
(E-Mail Removed) a écrit :
>
> Now, supposing that the two interfaces of linuxbox (I'll call it that)
> were on seperate networks, for example 192.168.1.0/24 and
> 192.168.2.0/24, and that hosts on those two networks were configured to
> rely on linuxbox as their gateway...
>
> Would an incoming packet from host on the 192.168.1.0/24 network
> destined for a host on 192.168.2.0/24 network automatically be
> forwarded by linuxbox as long as /proc/sys/net/ip_forward is set to 1?


Yes, if the routes are correct too.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Routing - Computers on either subnet have problems finding PCs on the other subnet ZZYZX Windows Networking 2 03-26-2011 01:01 AM
Strange mrouted / kernel routing behaviour Ralph B Linux Networking 1 09-19-2007 05:16 PM
two nics on same subnet vj Linux Networking 1 01-19-2007 04:03 PM
RH + 3 NICS Strange Behaviour John Miller Linux Networking 0 01-03-2005 09:52 PM
subnet to subnet routing question S James Linux Networking 0 09-04-2003 03:37 PM



1 2 3 4 5 6 7 8 9 10 11