kvm-ifup bug with complex default routes
A user just submitted a bug report against the kvm-18 debian package. You can find the bug report at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151
The user has a default route with extra features and the kvm-ifup script fails for him, his default route looks like:
default via 10.0.0.138 dev br0 metric 1 realm 10
His suggestion to fix is:
-switch=$(/sbin/ip route list | awk '/^default / { print $NF }')
+switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if ($(i) == "dev") print $(i+1) }}')
Cheers,
Baruch
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Quoted 6 lines
A user just submitted a bug report against the kvm-18 debian package. You can find the bug report at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151The user has a default route with extra features and the kvm-ifup
script
Review
Quoted 6 lines
fails for him, his default route looks like:
default via 10.0.0.138 dev br0 metric 1 realm 10His suggestion to fix is:
(quoted diff) +1
-1-switch=$(/sbin/ip route list | awk '/^default / { print $NF }') +switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if
($(i) ==
Quoted 1 line
"dev") print $(i+1) }}')
Actually using the default route in order to get the bridge name is a bad thing. The best is to use brctl show and pick the bridge that has the interface attached.
Quoted 5 lines
Cheers,
Baruch-----------------------------------------------------------------------
--
Quoted 5 lines
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVD
EV
Quoted 4 lines
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Quoted 14 lines · Dor Laor
Quoted 6 lines
A user just submitted a bug report against the kvm-18 debian package. You can find the bug report at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151The user has a default route with extra features and the kvm-ifup
script
Review
Quoted 6 lines
fails for him, his default route looks like:
default via 10.0.0.138 dev br0 metric 1 realm 10His suggestion to fix is:
(quoted diff) +1
-1-switch=$(/sbin/ip route list | awk '/^default / { print $NF }') +switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if($(i) ==
Quoted 5 lines
Quoted 1 line
"dev") print $(i+1) }}')
Actually using the default route in order to get the bridge name is a bad thing. The best is to use brctl show and pick the bridge that has the interface attached.
The current approach has its problems, especially if there is no bridge defined. But what if I have multiple bridges? You will need to figure out which one of them to use.
But then, this script can't take care of all situations, only of simple and common ones, the fix suggested above just improves coverage for a few more cases.
Baruch
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Quoted 26 lines · Baruch Even
Quoted 17 lines · Dor Laor
Quoted 6 lines
A user just submitted a bug report against the kvm-18 debian package. You can find the bug report at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151The user has a default route with extra features and the kvm-ifup
script
Review
Quoted 7 lines
fails for him, his default route looks like:
default via 10.0.0.138 dev br0 metric 1 realm 10His suggestion to fix is:
(quoted diff) +1
-1-switch=$(/sbin/ip route list | awk '/^default / { print $NF }') +switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if($(i) ==
Quoted 6 lines
Quoted 2 lines
"dev") print $(i+1) }}')
Actually using the default route in order to get the bridge name is a bad thing. The best is to use brctl show and pick the bridge that has the interface attached.
Quoted 8 lines
The current approach has its problems, especially if there is no bridge defined. But what if I have multiple bridges? You will need to figure out which one of them to use.
But then, this script can't take care of all situations, only of simple and common ones, the fix suggested above just improves coverage for a few more cases.
I think the correct solution is to set up the bridge where and when networking is configured, using the regular configuration files and supported by the regular tools. That's the only way we can deal with all the various options. If there's only one bridge, qemu can use it; if there's more, qemu-ifup should read some configuration file to select the bridge.
Fedora has some support for bridging in initscripts: I have an ifcfg-sw0 with TYPE=Bridge and ifcfg-eth0 with BRIDGE=sw0. Seems to work fine, and no need to transfer addresses and routes and dhcp client daemons and whatnot.
Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Quoted 4 lines
Quoted 3 lines · Baruch Even
Quoted 1 line · Dor Laor
Quoted 1 line
A user just submitted a bug report against the kvm-18 debian
package.
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Quoted 5 lines
You can find the bug report at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151The user has a default route with extra features and the kvm-ifup
script
Review
Quoted 7 lines
fails for him, his default route looks like:
default via 10.0.0.138 dev br0 metric 1 realm 10His suggestion to fix is:
(quoted diff) +1
-1-switch=$(/sbin/ip route list | awk '/^default / { print $NF }') +switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if($(i) ==
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
"dev") print $(i+1) }}')
Actually using the default route in order to get the bridge name is
a
Quoted 1 line
Quoted 1 line
Quoted 1 line
bad thing. The best is to use brctl show and pick the bridge that
has
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
the interface attached.
The current approach has its problems, especially if there is no
bridge
Quoted 4 lines
Quoted 4 lines
defined. But what if I have multiple bridges? You will need to figure out which one of them to use.
But then, this script can't take care of all situations, only of
simple
Quoted 9 lines
Quoted 3 lines
and common ones, the fix suggested above just improves coverage for a few more cases.
I think the correct solution is to set up the bridge where and when networking is configured, using the regular configuration files and supported by the regular tools. That's the only way we can deal with all the various options. If there's only one bridge, qemu can use it; if there's more, qemu-ifup should read some configuration file to
select
Quoted 3 lines
the bridge.
Fedora has some support for bridging in initscripts: I have an
ifcfg-sw0
Quoted 2 lines
with TYPE=Bridge and ifcfg-eth0 with BRIDGE=sw0. Seems to work fine, and no need to transfer addresses and routes and dhcp client daemons
and
Quoted 1 line
whatnot.
In general you're right. The only problem is that the ifcfg-XX scripts do not work well while having bridge over bond interface.
If someone of our Redhat friends and also at debian will pick up the glove
and fix it we will do the same.
Anyway I think qemu guys use such call to external script because there are
plenty of distributions.
So first the script should use the existing bridge, then the standard bridge
creation tools can be used.
Quoted 3 lines
--
Do not meddle in the internals of kernels, for they are subtle and
quick to
Quoted 1 line
panic.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV