You are not logged in.

#1 2010-08-18 18:40:34

frank_s
Member
From: Rostock
Registered: 2010-08-18
Posts: 7

[solved] network bonding cause huge delay of dhcp

Hi, all
I'am new to Arch. Previously I've used Kubuntu, Mandriva, Debian and Debian Unstable. Now, I've setup Arch with KDE smoothly but some issues remain.
According to intructions of some threads here and the Wiki, I've setup network bonding with tow nics. My rc.conf

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime", any other value will result
#   in the hardware clock being left untouched (useful for virtualization)
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="de_DE.UTF-8"
HARDWARECLOCK="UTC"
TIMEZONE="Europe/Berlin"
KEYMAP="de-latin1-nodeadkeys"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=(mii r8169 bonding)

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="yes"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="randy"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   - prefix an entry in INTERFACES with a ! to disable it
#   - no hyphens in your interface names - Bash doesn't like it
# 
# DHCP:     Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#

#Static IP example
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
eth0="eth0"
eth1="eth1"
bond0="dhcp"
#INTERFACES=(eth0)
INTERFACES=(eth0 eth1 bond0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.0.1"
ROUTES=(!gateway)
 
# Setting this to "yes" will skip network shutdown.
# This is required if your root device is on NFS.
NETWORK_PERSIST="no"

# Enable these network profiles at boot-up.  These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up (dialog package required)
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
#NETWORKS=(main)

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng dbus hal network netfs ntp crond avahi-daemon avahi-dnsconfd cdemud alsa)

modprobe.d/modprobe.conf

#
# /etc/modprobe.d/modprobe.conf (for v2.6 kernels)
options snd-pcsp index=2
# disable autoload of ipv6
alias net-pf-10 off
#alias bond0 bonding
#alias eth0 r8169
#alias eth1 r8169
options bonding max_bonds=1 mode=0 miimon=1000
#

Additionally I've tried to set

#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
#dhcpcd -k eth0
#dhcpcd -k eth1
dhcpcd -k bond0
dhcpcd -nd bond0

in rc.local. Furthermore I've tried to set eth0, eth1 to ethX="ethx up" in rc.conf as well as deleting both in Interfaces section of rc.conf.
But on each boot and each case I got an huge delay of about 1-2 minutes on task: starting Network [busy].
Afterwards the connection is available.

If I stop networking and restart it again via /etc/rc.d/network stop|start, I get

tail -f /var/log/messages
Aug 18 19:59:50 localhost dhcpcd[2899]: version 5.2.7 starting                                                  
Aug 18 19:59:50 localhost dhcpcd[2899]: bond0: waiting for carrier                                              
Aug 18 19:59:51 localhost avahi-daemon[2113]: Registering new address record for fe80::224:8cff:fe58:e824 on eth0.*.                                                                                                            
Aug 18 19:59:52 localhost avahi-daemon[2113]: Registering new address record for fe80::224:8cff:fe58:eaab on eth1.*.                                                                                                            
Aug 18 20:00:20 localhost dhcpcd[2899]: allowing 8 seconds for IPv4LL timeout                                   
Aug 18 20:00:28 localhost avahi-daemon[2113]: Withdrawing address record for fe80::224:8cff:fe58:e824 on eth0.  
Aug 18 20:00:28 localhost kernel: r8169 0000:09:00.0: eth0: link up                                             
Aug 18 20:00:28 localhost kernel: bonding: bond0: enslaving eth0 as an active interface with an up link.        
Aug 18 20:00:28 localhost kernel: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready                            
Aug 18 20:00:28 localhost avahi-daemon[2113]: Withdrawing address record for fe80::224:8cff:fe58:eaab on eth1.  
Aug 18 20:00:28 localhost kernel: r8169 0000:08:00.0: eth1: link up                                             
Aug 18 20:00:28 localhost kernel: bonding: bond0: enslaving eth1 as an active interface with an up link.
Aug 18 20:00:28 localhost kernel: bond0: IPv6 duplicate address fe80::225:8cff:fe58:eaab detected!
Aug 18 20:00:28 localhost avahi-daemon[2113]: Registering new address record for fe80::225:8cff:fe58:eaab on bond0.*.

But afterwards bond0 did not get an ip-address and the link becomes not ready.
This could be resolved by manually issue :

[root@randy log]# dhcpcd bond0

dhcpcd[2915]: version 5.2.7 starting
dhcpcd[2915]: bond0: rebinding lease of 192.168.0.21
dhcpcd[2915]: bond0: acknowledged 192.168.0.21 from 192.168.0.1
dhcpcd[2915]: bond0: checking for 192.168.0.21
dhcpcd[2915]: bond0: leased 192.168.0.21 for 86400 seconds
dhcpcd[2915]: forked to background, child pid 2936

I've also noticed that every time bond0 becomes ready, the mac address of eth0 and eth1 is set to that of bond0, despite I've
setup a udev rule which should set the mac of eth0 and eth1 correctly.

#PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:24:8c:58:ea:ab", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:24:8c:58:e8:24", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

To avoid this I've tried to set up a uniqe mac address for bond0 in /etc/rc.d/network

..... some unmodified lines skipped

bond_up()
{
        /sbin/ifconfig bond0 hw ether 00:25:8c:58:ea:ab || error=1
        for ifline in ${BOND_INTERFACES[@]}; do
                if [ "$ifline" = "${ifline#!}" ]; then
                        eval bondcfg="\$bond_${ifline}"
                        if [ -n "${bondcfg}" ]; then
                                /sbin/ifenslave $ifline $bondcfg || error=1
                        fi
                fi
        done
}

....rest remains unchanged, therefore skipped

But again the mac address of eth0 and eth1 are changed to that of bond0. Previously (before applying this hack, bond0, eth0 and eth1 mac address was changed to that of eth0

For Debian it is mentioned elsewhere that the mac address of each interface MUST be unique to work properly. However, bonding does not change the mac in debian.

Any advice or suggestions.
Thanks in advanced

Frank

Last edited by frank_s (2010-08-22 11:53:21)

Offline

#2 2010-08-19 01:55:30

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: [solved] network bonding cause huge delay of dhcp

after bonding, the bond0 device becomes a single nic, so it uses a single mac address for slave devices as well as the bond device (so that every network connected only sees a single device)

as for the dhcp problem, it could be that the bonding is done before eth0/eth1 are up, try removing bond0 from rc.conf and addign it to rc.local, see if this speeds up the time.

Offline

#3 2010-08-19 18:25:36

frank_s
Member
From: Rostock
Registered: 2010-08-18
Posts: 7

Re: [solved] network bonding cause huge delay of dhcp

Sorry for late response, but I've had to work.

Thank you Sin.citadel for your hints.
I've changed rc.conf to

eth0="eth0 up"
eth1="eth1 up"
bond0="bond0 up"
INTERFACES=(eth0 eth1 bond0)

and rc.local to

dhcpcd -k bond0
dhcpcd -nd bond0

After that the time out was decreased, but I get still following message during each boot

Aug 19 22:10:16 localhost avahi-daemon[2069]: Found user 'avahi' (UID 84) and group 'avahi' (GID 84).
Aug 19 22:10:16 localhost avahi-daemon[2069]: Successfully dropped root privileges.
Aug 19 22:10:16 localhost avahi-daemon[2069]: avahi-daemon 0.6.25 starting up.
Aug 19 22:10:16 localhost avahi-daemon[2069]: Successfully called chroot().
Aug 19 22:10:16 localhost avahi-daemon[2069]: Successfully dropped remaining capabilities.
Aug 19 22:10:16 localhost avahi-daemon[2069]: Loading service file /services/sftp-ssh.service.
Aug 19 22:10:16 localhost avahi-daemon[2069]: Loading service file /services/ssh.service.
Aug 19 22:10:16 localhost avahi-daemon[2069]: Network interface enumeration completed.
Aug 19 22:10:16 localhost avahi-daemon[2069]: Registering new address record for fe80::224:8cff:fe58:e824 on bond0.*.
Aug 19 22:10:16 localhost avahi-daemon[2069]: Server startup complete. Host name is randy.local. Local service cookie is 3964017936.
Aug 19 22:10:16 localhost avahi-daemon[2069]: Service "randy" (/services/ssh.service) successfully established.
Aug 19 22:10:16 localhost avahi-daemon[2069]: Service "SFTP File Transfer on randy" (/services/sftp-ssh.service) successfully established.
Aug 19 22:10:16 localhost avahi-daemon[2069]: Registering HINFO record with values 'X86_64'/'LINUX'.
Aug 19 22:10:16 localhost avahi-dnsconfd[2079]: Successfully connected to Avahi daemon.
Aug 19 22:10:17 localhost dhcpcd[2090]: dhcpcd not running
Aug 19 22:10:17 localhost dhcpcd[2091]: version 5.2.7 starting
Aug 19 22:10:17 localhost dhcpcd[2091]: bond0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason PREINIT
Aug 19 22:10:17 localhost dhcpcd[2091]: bond0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason CARRIER
Aug 19 22:10:17 localhost dhcpcd[2091]: bond0: reading lease `/var/lib/dhcpcd/dhcpcd-bond0.lease'
Aug 19 22:10:17 localhost dhcpcd[2091]: bond0: checking for 169.254.58.106
Aug 19 22:10:17 localhost dhcpcd[2091]: bond0: sending ARP probe (1 of 3), next in 1.62 seconds
Aug 19 22:10:15 localhost init: Entering runlevel: 5
Aug 19 22:10:18 localhost dhcpcd[2091]: bond0: sending ARP probe (2 of 3), next in 1.27 seconds
Aug 19 22:10:20 localhost dhcpcd[2091]: bond0: sending ARP probe (3 of 3), next in 2.00 seconds
Aug 19 22:10:22 localhost dhcpcd[2091]: bond0: using IPv4LL address 169.254.58.106
Aug 19 22:10:22 localhost dhcpcd[2091]: bond0: adding IP address 169.254.58.106/16
Aug 19 22:10:22 localhost avahi-daemon[2069]: Joining mDNS multicast group on interface bond0.IPv4 with address 169.254.58.106.
Aug 19 22:10:22 localhost dhcpcd[2091]: bond0: adding route to 169.254.0.0/16
Aug 19 22:10:22 localhost avahi-daemon[2069]: New relevant interface bond0.IPv4 for mDNS.
Aug 19 22:10:22 localhost avahi-daemon[2069]: Registering new address record for 169.254.58.106 on bond0.IPv4.
Aug 19 22:10:22 localhost dhcpcd[2091]: bond0: writing lease `/var/lib/dhcpcd/dhcpcd-bond0.lease'
Aug 19 22:10:22 localhost dhcpcd[2091]: bond0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason IPV4LL
Aug 19 22:10:22 localhost dhcpcd[2091]: forking to background
Aug 19 22:10:22 localhost dhcpcd[2091]: forked to background, child pid 2104
Aug 19 22:10:22 localhost dhcpcd[2104]: bond0: sending ARP announce (1 of 2), next in 2.00 seconds
Aug 19 22:10:24 localhost dhcpcd[2104]: bond0: sending ARP announce (2 of 2)
Aug 19 22:10:26 localhost dhcpcd[2104]: bond0: broadcasting for a lease
Aug 19 22:10:26 localhost dhcpcd[2104]: bond0: sending DISCOVER (xid 0x2fd6010a), next in 4.06 seconds
Aug 19 22:10:27 localhost dhcpcd[2104]: bond0: offered 192.168.0.9 from 192.168.0.1
Aug 19 22:10:27 localhost dhcpcd[2104]: bond0: sending REQUEST (xid 0x2fd6010a), next in 4.19 seconds
Aug 19 22:10:27 localhost dhcpcd[2104]: bond0: ignoring offer of 192.168.0.9 from 192.168.0.1
Aug 19 22:10:27 localhost dhcpcd[2104]: bond0: acknowledged 192.168.0.9 from 192.168.0.1
Aug 19 22:10:27 localhost dhcpcd[2104]: bond0: checking for 192.168.0.9
Aug 19 22:10:27 localhost dhcpcd[2104]: bond0: sending ARP probe (1 of 3), next in 1.75 seconds
Aug 19 22:10:28 localhost kdm_greet[2119]: Data directory "/var/lib/kdm" not accessible: Permission denied
Aug 19 22:10:29 localhost dhcpcd[2104]: bond0: sending ARP probe (2 of 3), next in 1.53 seconds
Aug 19 22:10:30 localhost kdm_greet[2119]: Cannot load /usr/share/apps/kdm/faces/.default.face: No such file or directory
Aug 19 22:10:31 localhost dhcpcd[2104]: bond0: sending ARP probe (3 of 3), next in 2.00 seconds
Aug 19 22:10:33 localhost dhcpcd[2104]: bond0: leased 192.168.0.9 for 86400 seconds
Aug 19 22:10:33 localhost dhcpcd[2104]: bond0: adding IP address 192.168.0.9/24
Aug 19 22:10:33 localhost dhcpcd[2104]: bond0: deleting IP address 169.254.58.106/16
Aug 19 22:10:33 localhost dhcpcd[2104]: bond0: adding route to 192.168.0.0/24
Aug 19 22:10:33 localhost dhcpcd[2104]: bond0: adding default route via 192.168.0.1
Aug 19 22:10:33 localhost dhcpcd[2104]: bond0: deleting route to 169.254.0.0/16
Aug 19 22:10:33 localhost dhcpcd[2104]: bond0: writing lease `/var/lib/dhcpcd/dhcpcd-bond0.lease'
Aug 19 22:10:33 localhost avahi-daemon[2069]: Registering new address record for 192.168.0.9 on bond0.IPv4.
Aug 19 22:10:33 localhost avahi-daemon[2069]: Withdrawing address record for 169.254.58.106 on bond0.
Aug 19 22:10:33 localhost dhcpcd[2104]: bond0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks', reason REBIND
Aug 19 22:10:33 localhost avahi-daemon[2069]: Leaving mDNS multicast group on interface bond0.IPv4 with address 169.254.58.106.
Aug 19 22:10:33 localhost avahi-daemon[2069]: Joining mDNS multicast group on interface bond0.IPv4 with address 192.168.0.9.
Aug 19 22:10:33 localhost dhcpcd[2104]: bond0: sending ARP announce (1 of 2), next in 2.00 seconds
Aug 19 22:10:35 localhost dhcpcd[2104]: bond0: sending ARP announce (2 of 2)
Aug 19 22:10:48 localhost polkitd[2389]: started daemon version 0.96 using authority implementation `local' version `0.96'

It seem, that dhcp need to try twice to get the right address.

By the way another topic and probably I had to open a new topic about, but how to resolve

Aug 19 22:10:28 localhost kdm_greet[2119]: Data directory "/var/lib/kdm" not accessible: Permission denied

Frank

Offline

#4 2010-08-21 05:06:45

Sin.citadel
Member
Registered: 2008-01-22
Posts: 267

Re: [solved] network bonding cause huge delay of dhcp

it is still manageable, but if the timeout is a bother, you can set the ip address statically.

as for the directory problem, check the directorty /var/lib/kdm and see if the user for process kdm_greet has r,x access to it.

Offline

#5 2010-08-22 11:52:54

frank_s
Member
From: Rostock
Registered: 2010-08-18
Posts: 7

Re: [solved] network bonding cause huge delay of dhcp

Thank you Sin.citadel,
you are right it is manageable, but a bit annoying.
So, i will marked this thread as being solved

Frank

Offline

Board footer

Powered by FluxBB