Linux Netfilter discussions
 help / color / mirror / Atom feed
* two default routes
@ 2010-03-22 10:35 ratheesh k
  2010-03-22 12:48 ` Richard Horton
  2010-03-22 14:54 ` Pascal Hambourg
  0 siblings, 2 replies; 9+ messages in thread
From: ratheesh k @ 2010-03-22 10:35 UTC (permalink / raw)
  To: netfilter

Hi ,

 i have two default routes  , I used below two commands to add routes .

 route add default gw 192.168.1.1  dev eth0 metric 0
 route add default gw 10.232.18.5  dev eth1 metric 1

So  10.232.18.5 will become the default route since it is added
secondly . All packets are routed to this address . Suppose
10.232.18.5 machine is down  , will the packets will use the next
default route ? . Could you please mention any case in which packets
will use the route 192.168.1.1 .?

Thanks,
Ratheesh

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: two default routes
  2010-03-22 10:35 two default routes ratheesh k
@ 2010-03-22 12:48 ` Richard Horton
  2010-03-22 14:54 ` Pascal Hambourg
  1 sibling, 0 replies; 9+ messages in thread
From: Richard Horton @ 2010-03-22 12:48 UTC (permalink / raw)
  To: ratheesh k; +Cc: netfilter

On 22 March 2010 10:35, ratheesh k <ratheesh.ksz@gmail.com> wrote:
> Hi ,
>
>  i have two default routes  , I used below two commands to add routes .
>
>  route add default gw 192.168.1.1  dev eth0 metric 0
>  route add default gw 10.232.18.5  dev eth1 metric 1
>

Without using rule based routing (part of iproute2) I don't believe
this will do anything - only one of the two default routes will ever
be used unless the eth0/eth1 interface itself changes to the down
state in which case its associated route should be removed.


-- 
Richard Horton
Users are like a virus: Each causing a thousand tiny crises until the
host finally dies.
http://www.solstans.co.uk - Solstans Japanese Bobtails and Norwegian Forest Cats
http://www.pbase.com/arimus - My online photogallery

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: two default routes
  2010-03-22 10:35 two default routes ratheesh k
  2010-03-22 12:48 ` Richard Horton
@ 2010-03-22 14:54 ` Pascal Hambourg
  2010-03-22 15:05   ` ratheesh k
  1 sibling, 1 reply; 9+ messages in thread
From: Pascal Hambourg @ 2010-03-22 14:54 UTC (permalink / raw)
  To: netfilter

Hello,

ratheesh k a écrit :
> 
>  i have two default routes  , I used below two commands to add routes .
> 
>  route add default gw 192.168.1.1  dev eth0 metric 0
>  route add default gw 10.232.18.5  dev eth1 metric 1
> 
> So  10.232.18.5 will become the default route since it is added
> secondly . All packets are routed to this address.

No. Lower metric wins regardless of route order, so the default gateway
is 192.168.1.1. You can check with "ip route get <destination>".

> Suppose
> 10.232.18.5 machine is down  , will the packets will use the next
> default route ?

No, the kernel has no dead gateway detection AFAIK.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: two default routes
  2010-03-22 14:54 ` Pascal Hambourg
@ 2010-03-22 15:05   ` ratheesh k
  2010-03-22 15:47     ` Pascal Hambourg
  0 siblings, 1 reply; 9+ messages in thread
From: ratheesh k @ 2010-03-22 15:05 UTC (permalink / raw)
  To: Pascal Hambourg; +Cc: netfilter

On Mon, Mar 22, 2010 at 8:24 PM, Pascal Hambourg
<pascal.mail@plouf.fr.eu.org> wrote:
> Hello,
>
> ratheesh k a écrit :
>>
>>  i have two default routes  , I used below two commands to add routes .
>>
>>  route add default gw 192.168.1.1  dev eth0 metric 0
>>  route add default gw 10.232.18.5  dev eth1 metric 1
>>
>> So  10.232.18.5 will become the default route since it is added
>> secondly . All packets are routed to this address.
>
> No. Lower metric wins regardless of route order, so the default gateway
> is 192.168.1.1. You can check with "ip route get <destination>".
>
>> Suppose
>> 10.232.18.5 machine is down  , will the packets will use the next
>> default route ?
>
> No, the kernel has no dead gateway detection AFAIK.
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


Thanks a lot . I have a related question .
suppose ip  8.8.8.8  is accessible thru gateway 10.232.18.5 and we
configured the linux machine to accept
icmp redirect messages ( if we set NET_IPV4_CONF_ACCEPT_REDIRECTS )  .
Linux will send packet to 8.8.8.8  thru 192.168.1.1 as per default
route . The gateway machine  ( ip 192.168.1.1 ) will respond back with
icmp redirect . (I think so ) . So our linux machine can use the other
route ?

thanks,
ratheesh

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: two default routes
  2010-03-22 15:05   ` ratheesh k
@ 2010-03-22 15:47     ` Pascal Hambourg
  2010-03-22 15:56       ` ratheesh k
  2010-03-22 16:21       ` Richard Horton
  0 siblings, 2 replies; 9+ messages in thread
From: Pascal Hambourg @ 2010-03-22 15:47 UTC (permalink / raw)
  To: netfilter

ratheesh k a écrit :
> 
> suppose ip  8.8.8.8  is accessible thru gateway 10.232.18.5 and we
> configured the linux machine to accept
> icmp redirect messages ( if we set NET_IPV4_CONF_ACCEPT_REDIRECTS )  .

Do you mean sysctl net.ipv4.conf.<interface>.accept_redirects ?
Note that this settings is ignored (and so are ICMP redirects) when
forwarding is enabled, thus when Linux acts as a router.

> Linux will send packet to 8.8.8.8  thru 192.168.1.1 as per default
> route . The gateway machine  ( ip 192.168.1.1 ) will respond back with
> icmp redirect . (I think so )

If it is configured to do so. If it runs a Linux kernel, see sysctl
net.ipv4.conf.<interface>.send_redirects.

> So our linux machine can use the other route ?

Yes, a temporary redirect route to 8.8.8.8 will be created in the
routing cache. You can see it with "ip route show cache".

Note : This does not seem to be much related to netfilter.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: two default routes
  2010-03-22 15:47     ` Pascal Hambourg
@ 2010-03-22 15:56       ` ratheesh k
  2010-03-22 16:53         ` Pascal Hambourg
  2010-03-22 16:21       ` Richard Horton
  1 sibling, 1 reply; 9+ messages in thread
From: ratheesh k @ 2010-03-22 15:56 UTC (permalink / raw)
  To: Pascal Hambourg; +Cc: netfilter

On Mon, Mar 22, 2010 at 9:17 PM, Pascal Hambourg
<pascal.mail@plouf.fr.eu.org> wrote:
> ratheesh k a écrit :
>>
>> suppose ip  8.8.8.8  is accessible thru gateway 10.232.18.5 and we
>> configured the linux machine to accept
>> icmp redirect messages ( if we set NET_IPV4_CONF_ACCEPT_REDIRECTS )  .
>
> Do you mean sysctl net.ipv4.conf.<interface>.accept_redirects ?
> Note that this settings is ignored (and so are ICMP redirects) when
> forwarding is enabled, thus when Linux acts as a router.
>
>> Linux will send packet to 8.8.8.8  thru 192.168.1.1 as per default
>> route . The gateway machine  ( ip 192.168.1.1 ) will respond back with
>> icmp redirect . (I think so )
>
> If it is configured to do so. If it runs a Linux kernel, see sysctl
> net.ipv4.conf.<interface>.send_redirects.
>
>> So our linux machine can use the other route ?
>
> Yes, a temporary redirect route to 8.8.8.8 will be created in the
> routing cache. You can see it with "ip route show cache".
>
> Note : This does not seem to be much related to netfilter.
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

thanks a ton .

>>>>>>> Note : This does not seem to be much related to netfilter

I agree . I should not ask this kind of questions here ( any thing
other than netfilter )  ?

thanks,
ratheesh

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: two default routes
  2010-03-22 15:47     ` Pascal Hambourg
  2010-03-22 15:56       ` ratheesh k
@ 2010-03-22 16:21       ` Richard Horton
  2010-03-22 16:26         ` Jan Engelhardt
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Horton @ 2010-03-22 16:21 UTC (permalink / raw)
  To: netfilter

On 22 March 2010 15:47, Pascal Hambourg <pascal.mail@plouf.fr.eu.org> wrote:
> Note : This does not seem to be much related to netfilter.


IP Routing is about the one area of linux which lacks a decent mailing
list - the iproute/lartc mailing lists are dead/defunct/ex-mailing
lists :(

-- 
Richard Horton
Users are like a virus: Each causing a thousand tiny crises until the
host finally dies.
http://www.solstans.co.uk - Solstans Japanese Bobtails and Norwegian Forest Cats
http://www.pbase.com/arimus - My online photogallery

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: two default routes
  2010-03-22 16:21       ` Richard Horton
@ 2010-03-22 16:26         ` Jan Engelhardt
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Engelhardt @ 2010-03-22 16:26 UTC (permalink / raw)
  To: Richard Horton; +Cc: netfilter

On Monday 2010-03-22 17:21, Richard Horton wrote:

>On 22 March 2010 15:47, Pascal Hambourg <pascal.mail@plouf.fr.eu.org> wrote:
>> Note : This does not seem to be much related to netfilter.
>
>
>IP Routing is about the one area of linux which lacks a decent mailing
>list - the iproute/lartc mailing lists are dead/defunct/ex-mailing
>lists :(

NF will happily jump in :)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: two default routes
  2010-03-22 15:56       ` ratheesh k
@ 2010-03-22 16:53         ` Pascal Hambourg
  0 siblings, 0 replies; 9+ messages in thread
From: Pascal Hambourg @ 2010-03-22 16:53 UTC (permalink / raw)
  To: netfilter

ratheesh k a écrit :
> On Mon, Mar 22, 2010 at 9:17 PM, Pascal Hambourg
>
> I agree . I should not ask this kind of questions here ( any thing
> other than netfilter )  ?

It's fine with me if no one else complains. There is a more general
Linux networking list, linux-net, which does not seem to receive much
traffic though.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-03-22 16:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 10:35 two default routes ratheesh k
2010-03-22 12:48 ` Richard Horton
2010-03-22 14:54 ` Pascal Hambourg
2010-03-22 15:05   ` ratheesh k
2010-03-22 15:47     ` Pascal Hambourg
2010-03-22 15:56       ` ratheesh k
2010-03-22 16:53         ` Pascal Hambourg
2010-03-22 16:21       ` Richard Horton
2010-03-22 16:26         ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox