FS#11781 - [initscripts] net: NIC bonding does not work when using dhcp
Attached to Project:
Arch Linux
Opened by Joern Koerner (jko) - Friday, 17 October 2008, 09:04 GMT
Last edited by Tom Gundersen (tomegun) - Saturday, 04 June 2011, 18:16 GMT
Opened by Joern Koerner (jko) - Friday, 17 October 2008, 09:04 GMT
Last edited by Tom Gundersen (tomegun) - Saturday, 04 June 2011, 18:16 GMT
|
Details
Description:
When using NIC bonding (ifenslave) and configuring it to fetch the ipaddress via dhcp the bond0 device does not get an ip: timed out. This is a bug in /etc/rc.d/network script. Anyway there seems no way to reconfigure a bonding device wirh network restart . bond_down simply does not exists... Additional info: * initscripts 2008.09-2 Steps to reproduce: Set up a bonding device as described in http://wiki.archlinux.org/index.php/Configuring_network#bonding and in /etc/rc.conf say ... bond0="dhcp" ... Resolution: I've reworked the /etc/rc.d/network script a little bit. 1. Moved bond_up right after bridge_up and before "#bring up ethernet interfaces" 2. Modified bond_up() function: bond_up() { for ifline in ${BOND_INTERFACES[@]}; do if [ "$ifline" = "${ifline#!}" ]; then eval bondcfg="\$bond_${ifline}" for ifl in ${bondcfg}; do /sbin/ifconfig $ifl up done /sbin/ifconfig $ifline up /sbin/ifenslave $ifline $bondcfg || error=1 fi done } Complete working /etc/rc.d/network is attached. |
This task depends upon
Closed by Tom Gundersen (tomegun)
Saturday, 04 June 2011, 18:16 GMT
Reason for closing: No response
Additional comments about closing: Use (or file a bug against) netcfg.
Saturday, 04 June 2011, 18:16 GMT
Reason for closing: No response
Additional comments about closing: Use (or file a bug against) netcfg.
FS#11761?The problem with unmodified network script it basically that ifup bond0 will be called before the bonding has been created - which will fail.
Then after the first network startup failed and you retry to start network it will work because now the bonding (ifenslave bond0 eth0 eth1) is correctly set up and the second ifup bond0 call will work.
sorry, but by the way - a very similar bug appears when using bridged networks. I had no time yet to figure out a valid resolution but it seems to be very similar. Since I cannot reproduce the bug right now I'll create a new one once I've some more details.
Best,
Joern
Thanks to the marvels of git, I created a patch from the network script provided against 2008.09-2, and ported it to the git head, though I had to manually resolve some conflicts in bond_up().
Can someone look at this patch, test it, and decide whether we should apply it? It seems pretty minimal.
However, I'd much rather not have advanced networking implemented in initscripts, but rather removed and implemented in netcfg (I recently implemented bridging in netcfg, but haven't submitted it yet, someone should do bonding as well).
FS#21490.