Possible kernel bug with routes
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.
PLEASE!!! Can anybody try this yourself and give me an explanation! I think this a kernel bug...
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 eth0Quoted 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 eth0Quoted 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?
As far as I understand routing should be handled independed from the addresses...
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
PPS: Why is ANYBODY still ignoring this e-mail for over 3 weeks?????
Regards
Sven Anders
Signature · 5 lines
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: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
On Mon, Mar 27, 2006 at 11:56:52AM +0200, Sven Anders wrote:
<snipped a lot>
Quoted 2 lines
Quoted 1 line
ip route add 10.100.0.0/24 dev eth0 proto kernel scope link
RTNETLINK answers: File exists
s/add/append/
Quoted 4 lines
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?
add prevents duplicates, append just adds.
Quoted 3 lines
Another question:
Why can't I set a route on an interface that is down?
That's by some design. Use patches from linuxvirtualserver.org if you want them to exist.
Quoted 1 line
I can set an address, so why not a route?
You don't set an address... The address exists only at the moment the interface comes up. Before that you don't have the address (active in your ip stack)
Quoted 3 lines
I there a reason for that?
As far as I understand routing should be handled independed from the addresses...
Jups
Quoted 5 lines
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 linkRTNETLINK answers: Network is down
The ip is not there yet.
ip link set up dev eth0 # Activate interfaces ip a add 127.0.0.1/32 dev eth0 # Bind interface to ipv4 stack ip a add 10.100.0.1/32 dev lo # We need a public ip on our ip stack
# Add the route to the interface with sane src ip. ip route add 10.100.0.0/24 dev eth0 src 10.100.0.1
Quoted 1 line
PPS: Why is ANYBODY still ignoring this e-mail for over 3 weeks?????
People are busy :-)
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
First of all: Thanks for the answer!!!!
Quoted 5 lines · Ard van Breemen
On Mon, Mar 27, 2006 at 11:56:52AM +0200, Sven Anders wrote:
<snipped a lot>Quoted 2 lines
Quoted 1 line
ip route add 10.100.0.0/24 dev eth0 proto kernel scope link
RTNETLINK answers: File exists
Quoted 8 lines
s/add/append/
Quoted 4 lines
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?add prevents duplicates, append just adds.
Ok, this would prevent the error, but it does not explain the error itself. Did you tried it yourself? All I want to know is, if I did a mistake. If so, please explain my error...
Quoted 6 lines
Quoted 3 lines
Another question:
Why can't I set a route on an interface that is down?
That's by some design. Use patches from linuxvirtualserver.org if you want them to exist.
Ok, I will try it... But what's the reason for this design?
I think, this test could be done in user-space and did not have to be in the kernel.
Quoted 4 lines
Quoted 2 lines
PPS: Why is ANYBODY still ignoring this e-mail for over 3 weeks?????
People are busy :-)
Ok, I understand this, but for over three weeks with so many people on this mailing list?? :-)
Regards
Sven
Signature · 5 lines
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: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