Skip to contentSkip to conversation

Problem with duplicate route entry

LARTC Sven Anders 1 participant 4 messages Mar 2, 2006 – Mar 13, 2006

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

I have a problem with a duplicate route entry, when using a pre-installed route and automatic take-over by the "heartbeat" daemon, which adds an address and the kernel adds an route automatically.

Maybe anyone has an explanation...

Quoted 1 line

ip addr

1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1514 qdisc pfifo_fast qlen 1000
    inet 10.10.20.100/32 scope global eth0
Quoted 1 line

ip route

127.0.0.0 dev lo scope link
10.10.20.0/24 dev eth0 scope link
default via 10.10.20.1 dev eth0

- -- Now I add a route for my ha net:

Quoted 2 lines

ip route add 10.100.0.0/24 dev eth0
ip route

127.0.0.0 dev lo scope link
10.10.20.0/24 dev eth0 scope link
10.100.0.0/24 dev eth0 scope link
default via 10.10.20.1 dev eth0

- -- The 'heartbeat' will add an address on switch-over:

Quoted 1 line

ip addr add 10.100.0.1/24 brd 10.100.0.255 dev eth0

ip addr
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1514 qdisc pfifo_fast qlen 1000
    inet 10.10.20.100/32 scope global eth0
    inet 10.100.0.1/24 brd 10.100.0.255 scope global eth0
Quoted 1 line

ip route

127.0.0.0 dev lo scope link

10.10.20.0/24 dev eth0  scope link
10.100.0.0/24 dev eth0  scope link
10.100.0.0/24 dev eth0  proto kernel  scope link  src 10.100.0.1

default via 10.10.20.1 dev eth0

My question is:
Why did the kernel add a duplicate routing entry, shouldn't it notice the existance and avoid this??

Is this a bug of the kernel?

Regards
Sven Anders

- --
Sven Anders <[email protected]> () Ascii Ribbon Campaign
/\ Support plain text e-mail
ANDURAS service solutions AG
Innstraße 71 - 94036 Passau - Germany
Web: www.anduras.de - Tel: +49 (0)851-4 90 50-0 - Fax: +49 (0)851-4 90 50-55
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEB0vK5lKZ7Feg4EcRAm9JAJ98WdYNLdYD675zXgxeWgDR67cRZQCgp/il 1k0Rv3YVrMUcynZtOUVnATQ=
=LJ/1
-----END PGP SIGNATURE-----

begin:vcard
fn:Sven Anders
n:Anders;Sven
org:ANDURAS AG;Research and Development adr;quoted-printable:;;Innstra=C3=9Fe 71;Passau;Bavaria;94036;Germany email;internet:[email protected]
title:Dipl. Inf.
tel;work:++49 (0)851 / 490 50 - 0
tel;fax:+49 (0)851 / 4 90 50 - 55
x-mozilla-html:FALSE
url:http://www.anduras.de
version:2.1
end:vcard

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#1 lore raw

[LARTC] Problem with duplicate route entry (2. TRY) / Route on

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

* I modified this a little bit and added some command to make it clearer. *

I have a problem with a duplicate route entry, when using a pre-installed route and automatic take-over by the "heartbeat" daemon, which adds an address and the kernel adds an route automatically.

Maybe anyone has an explanation...

Quoted 1 line

ip addr

1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1514 qdisc pfifo_fast qlen 1000
    inet 10.10.20.100/32 scope global eth0
Quoted 1 line

ip route

127.0.0.0 dev lo scope link
10.10.20.0/24 dev eth0 scope link
default via 10.10.20.1 dev eth0

- -- Now I add a route for my ha net:

Quoted 2 lines

ip route add 10.100.0.0/24 dev eth0 proto kernel scope link ip route

127.0.0.0 dev lo scope link
10.10.20.0/24 dev eth0 scope link
10.100.0.0/24 dev eth0 proto kernel scope link
default via 10.10.20.1 dev eth0

- -- The 'heartbeat' will add an address on switch-over:

Quoted 1 line

ip addr add 10.100.0.1/24 brd 10.100.0.255 dev eth0

ip addr
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1514 qdisc pfifo_fast qlen 1000
    inet 10.10.20.100/32 scope global eth0
    inet 10.100.0.1/24 brd 10.100.0.255 scope global eth0
Quoted 1 line

ip route

127.0.0.0 dev lo scope link

10.10.20.0/24 dev eth0  scope link
10.100.0.0/24 dev eth0  proto kernel  scope link
10.100.0.0/24 dev eth0  proto kernel  scope link  src 10.100.0.1

default via 10.10.20.1 dev eth0

My question is:
Why did the kernel add a duplicate routing entry, shouldn't it notice the existance and avoid this??
Is this a bug of the kernel?

| "Radoslaw Horodniczy" answered:
|
| This is not a bug, as you see there are 2 different routes

Ok, then try this:

Quoted 2 lines

ip route del 10.100.0.0/24 dev eth0 proto kernel scope link ip route

127.0.0.0 dev lo scope link
10.10.20.0/24 dev eth0 scope link
10.100.0.0/24 dev eth0 proto kernel scope link src 10.100.0.1 default via 10.10.20.1 dev eth0

Now I removed my manually set route. It succeeds.

If I then try to readd it, it fails. But why?

Quoted 1 line

ip route add 10.100.0.0/24 dev eth0 proto kernel scope link

RTNETLINK answers: File exists

I thought they are different!?!
Is here any difference I did not see?
If they are not different, why does the kernel not recognize it (see above) and avoid the duplicate entry?

- --------

Another question:

Why can't I set a route on an interface that is down? I can set an address, so why not a route?
I there a reason for that?

Example:

Quoted 3 lines

ip link set down dev eth0
ip addr add 10.100.0.1/24 dev eth0
ip route add 10.100.0.0/24 dev eth0 proto kernel scope link

RTNETLINK answers: Network is down

- --------

PS: I'm running Linux 2.6.15.1

Regards
Sven Anders

- --
Sven Anders <[email protected]> () Ascii Ribbon Campaign
/\ Support plain text e-mail
ANDURAS service solutions AG
Innstraße 71 - 94036 Passau - Germany
Web: www.anduras.de - Tel: +49 (0)851-4 90 50-0 - Fax: +49 (0)851-4 90 50-55
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEEcg15lKZ7Feg4EcRAlyqAKCQUX9KR2TwOVMwQxKc6nmUrIWMGwCgplEP 5VBAyUFx9g03rzMYMbgb8zs=
=k9ps
-----END PGP SIGNATURE-----

begin:vcard
fn:Sven Anders
n:Anders;Sven
org:ANDURAS AG;Research and Development adr;quoted-printable:;;Innstra=C3=9Fe 71;Passau;Bavaria;94036;Germany email;internet:[email protected]
title:Dipl. Inf.
tel;work:++49 (0)851 / 490 50 - 0
tel;fax:+49 (0)851 / 4 90 50 - 55
x-mozilla-html:FALSE
url:http://www.anduras.de
version:2.1
end:vcard

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#2 lore raw

[LARTC] Problem with duplicate route entry (2. TRY) / Route on

In reply to Sven Anders

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

* I modified this a little bit and added some command to make it clearer. *

I have a problem with a duplicate route entry, when using a pre-installed route and automatic take-over by the "heartbeat" daemon, which adds an address and the kernel adds an route automatically.

Maybe anyone has an explanation...

Quoted 1 line

ip addr

1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1514 qdisc pfifo_fast qlen 1000
    inet 10.10.20.100/32 scope global eth0
Quoted 1 line

ip route

127.0.0.0 dev lo scope link
10.10.20.0/24 dev eth0 scope link
default via 10.10.20.1 dev eth0

- -- Now I add a route for my ha net:

Quoted 2 lines

ip route add 10.100.0.0/24 dev eth0 proto kernel scope link ip route

127.0.0.0 dev lo scope link
10.10.20.0/24 dev eth0 scope link
10.100.0.0/24 dev eth0 proto kernel scope link
default via 10.10.20.1 dev eth0

- -- The 'heartbeat' will add an address on switch-over:

Quoted 1 line

ip addr add 10.100.0.1/24 brd 10.100.0.255 dev eth0

ip addr
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1514 qdisc pfifo_fast qlen 1000
    inet 10.10.20.100/32 scope global eth0
    inet 10.100.0.1/24 brd 10.100.0.255 scope global eth0
Quoted 1 line

ip route

127.0.0.0 dev lo scope link

10.10.20.0/24 dev eth0  scope link
10.100.0.0/24 dev eth0  proto kernel  scope link
10.100.0.0/24 dev eth0  proto kernel  scope link  src 10.100.0.1

default via 10.10.20.1 dev eth0

My question is:
Why did the kernel add a duplicate routing entry, shouldn't it notice the existance and avoid this??
Is this a bug of the kernel?

| "Radoslaw Horodniczy" answered:
|
| This is not a bug, as you see there are 2 different routes

Ok, then try this:

Quoted 2 lines

ip route del 10.100.0.0/24 dev eth0 proto kernel scope link ip route

127.0.0.0 dev lo scope link
10.10.20.0/24 dev eth0 scope link
10.100.0.0/24 dev eth0 proto kernel scope link src 10.100.0.1 default via 10.10.20.1 dev eth0

Now I removed my manually set route. It succeeds.

If I then try to readd it, it fails. But why?

Quoted 1 line

ip route add 10.100.0.0/24 dev eth0 proto kernel scope link

RTNETLINK answers: File exists

I thought they are different!?!
Is here any difference I did not see?
If they are not different, why does the kernel not recognize it (see above) and avoid the duplicate entry?

- --------

Another question:

Why can't I set a route on an interface that is down? I can set an address, so why not a route?
I there a reason for that?

Example:

Quoted 3 lines

ip link set down dev eth0
ip addr add 10.100.0.1/24 dev eth0
ip route add 10.100.0.0/24 dev eth0 proto kernel scope link

RTNETLINK answers: Network is down

- --------

PS: I'm running Linux 2.6.15.1

Regards
Sven Anders

- --
Sven Anders <[email protected]> () Ascii Ribbon Campaign
/\ Support plain text e-mail
ANDURAS service solutions AG
Innstraße 71 - 94036 Passau - Germany
Web: www.anduras.de - Tel: +49 (0)851-4 90 50-0 - Fax: +49 (0)851-4 90 50-55
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEFSjr5lKZ7Feg4EcRAiiWAJ9TBgoFJrK97rWKzDozwyspfPJzMACghzoJ rtx0kobKi0Tgbnz9LfCaQOM=
=pNVu
-----END PGP SIGNATURE-----

begin:vcard
fn:Sven Anders
n:Anders;Sven
org:ANDURAS AG;Research and Development adr;quoted-printable:;;Innstra=C3=9Fe 71;Passau;Bavaria;94036;Germany email;internet:[email protected]
title:Dipl. Inf.
tel;work:++49 (0)851 / 490 50 - 0
tel;fax:+49 (0)851 / 4 90 50 - 55
x-mozilla-html:FALSE
url:http://www.anduras.de
version:2.1
end:vcard

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#3 lore raw

[LARTC] Problem with duplicate route entry (2. TRY) / Route on

In reply to Sven Anders

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

(Sorry, if you got this mail twice, but the LARTC maillist server had problems).

Hello!

** I modified this a little bit and added some command to make it clearer. **

I have a problem with a duplicate route entry, when using a pre-installed route and automatic take-over by the "heartbeat" daemon, which adds an address and the kernel adds an route automatically.

Maybe anyone has an explanation...

Quoted 1 line

ip addr

1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1514 qdisc pfifo_fast qlen 1000
    inet 10.10.20.100/32 scope global eth0
Quoted 1 line

ip route

127.0.0.0 dev lo scope link
10.10.20.0/24 dev eth0 scope link
default via 10.10.20.1 dev eth0

- -- Now I add a route for my ha net:

Quoted 2 lines

ip route add 10.100.0.0/24 dev eth0 proto kernel scope link ip route

127.0.0.0 dev lo scope link
10.10.20.0/24 dev eth0 scope link
10.100.0.0/24 dev eth0 proto kernel scope link
default via 10.10.20.1 dev eth0

- -- The 'heartbeat' will add an address on switch-over:

Quoted 1 line

ip addr add 10.100.0.1/24 brd 10.100.0.255 dev eth0

ip addr
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1514 qdisc pfifo_fast qlen 1000
    inet 10.10.20.100/32 scope global eth0
    inet 10.100.0.1/24 brd 10.100.0.255 scope global eth0
Quoted 1 line

ip route

127.0.0.0 dev lo scope link

10.10.20.0/24 dev eth0  scope link
10.100.0.0/24 dev eth0  proto kernel  scope link
10.100.0.0/24 dev eth0  proto kernel  scope link  src 10.100.0.1

default via 10.10.20.1 dev eth0

My question is:
Why did the kernel add a duplicate routing entry, shouldn't it notice the existance and avoid this??
Is this a bug of the kernel?

| "Radoslaw Horodniczy" answered:
|
| This is not a bug, as you see there are 2 different routes

Ok, then try this:

Quoted 2 lines

ip route del 10.100.0.0/24 dev eth0 proto kernel scope link ip route

127.0.0.0 dev lo scope link
10.10.20.0/24 dev eth0 scope link
10.100.0.0/24 dev eth0 proto kernel scope link src 10.100.0.1 default via 10.10.20.1 dev eth0

Now I removed my manually set route. It succeeds.

If I then try to readd it, it fails. But why?

Quoted 1 line

ip route add 10.100.0.0/24 dev eth0 proto kernel scope link

RTNETLINK answers: File exists

I thought they are different!?!
Is here any difference I did not see?
If they are not different, why does the kernel not recognize it (see above) and avoid the duplicate entry?

- --------

Another question:

Why can't I set a route on an interface that is down? I can set an address, so why not a route?
I there a reason for that?

Example:

Quoted 3 lines

ip link set down dev eth0
ip addr add 10.100.0.1/24 dev eth0
ip route add 10.100.0.0/24 dev eth0 proto kernel scope link

RTNETLINK answers: Network is down

- --------

PS: I'm running Linux 2.6.15.1

Regards
Sven Anders

- --
Sven Anders <[email protected]> () Ascii Ribbon Campaign
/\ Support plain text e-mail
ANDURAS service solutions AG
Innstraße 71 - 94036 Passau - Germany
Web: www.anduras.de - Tel: +49 (0)851-4 90 50-0 - Fax: +49 (0)851-4 90 50-55

Mit freundlichen Grüßen
Sven Anders

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEFcFi5lKZ7Feg4EcRAsbNAKCTTnDmHACtK0jRknO+/DJZ3QotcQCfa6wa +XKjJP1EFDMSLCsN4PyNHr0=
=ox5B
-----END PGP SIGNATURE-----

begin:vcard
fn:Sven Anders
n:Anders;Sven
org:ANDURAS AG;Research and Development adr;quoted-printable:;;Innstra=C3=9Fe 71;Passau;Bavaria;94036;Germany email;internet:[email protected]
title:Dipl. Inf.
tel;work:++49 (0)851 / 490 50 - 0
tel;fax:+49 (0)851 / 4 90 50 - 55
x-mozilla-html:FALSE
url:http://www.anduras.de
version:2.1
end:vcard

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc