8

I'm running CentOS 7. I'm not running NetworkManager, and I've actually uninstalled it.

My system is supposed to acquire an IPv4 address via DHCP on br0 at boot. Howver, when I log in, it has no address.

My configuration:

# pwd
/etc/sysconfig/network-scripts

# cat ifcfg-enp5s0 
DEVICE=enp5s0
ONBOOT="yes"
BRIDGE=br0

# cat ifcfg-br0 
DEVICE=br0
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=dhcp
STP=on
DELAY=0

Note that I didn't configure this bridge manually; virt-manager did so when I added br0 on this dialog:

virt-manager screenshot showing br0 on Network Interfaces tab

Relevant journalctl --boot | grep '\(\<br0\>\|enp5s0\)' and context:

Jan 08 21:04:32 jonathon-centos7 kernel: r8169 0000:05:00.0 enp5s0: link down
Jan 08 21:04:32 jonathon-centos7 kernel: IPv6: ADDRCONF(NETDEV_UP): enp5s0: link is not ready
Jan 08 21:04:32 jonathon-centos7 kernel: r8169 0000:05:00.0 enp5s0: link down
Jan 08 21:04:32 jonathon-centos7 kernel: device enp5s0 entered promiscuous mode
Jan 08 21:04:32 jonathon-centos7 network[947]: Bringing up interface enp5s0:  [  OK  ]
...
Jan 08 21:04:32 jonathon-centos7 network[947]: Bringing up interface br0:
Jan 08 21:04:32 jonathon-centos7 kernel: IPv6: ADDRCONF(NETDEV_UP): br0: link is not ready
...
Jan 08 21:04:34 jonathon-centos7 kernel: r8169 0000:05:00.0 enp5s0: link up
Jan 08 21:04:34 jonathon-centos7 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): enp5s0: link becomes ready
Jan 08 21:04:34 jonathon-centos7 kernel: br0: port 1(enp5s0) entered listening state
Jan 08 21:04:34 jonathon-centos7 kernel: br0: port 1(enp5s0) entered listening state
//// (Note: 2 second delay here, with no other events)
Jan 08 21:04:36 jonathon-centos7 avahi-daemon[957]: Registering new address record for fe80::f66d:4ff:fe3b:c24e on enp5s0.*.
Jan 08 21:04:36 jonathon-centos7 kernel: br0: port 1(enp5s0) entered learning state
///// (Too soon!)
Jan 08 21:04:38 jonathon-centos7 network[947]: Determining IP information for br0... failed; no link present.  Check cable?
Jan 08 21:04:38 jonathon-centos7 network[947]: [FAILED]
Jan 08 21:04:38 jonathon-centos7 systemd[1]: network.service: control process exited, code=exited status=1
Jan 08 21:04:38 jonathon-centos7 systemd[1]: Failed to start LSB: Bring up/down networking.
Jan 08 21:04:38 jonathon-centos7 systemd[1]: Unit network.service entered failed state.
...
Jan 08 21:04:38 jonathon-centos7 kernel: br0: topology change detected, propagating
Jan 08 21:04:38 jonathon-centos7 kernel: br0: port 1(enp5s0) entered forwarding state
Jan 08 21:04:38 jonathon-centos7 kernel: IPv6: ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
Jan 08 21:04:39 jonathon-centos7 avahi-daemon[957]: Registering new address record for fe80::f66d:4ff:fe3b:c24e on br0.*.
Jan 08 21:04:41 jonathon-centos7 avahi-daemon[957]: Registering new address record for 2605:a000:1315:8119:f66d:4ff:fe3b:c24e on br0.*.
Jan 08 21:04:41 jonathon-centos7 avahi-daemon[957]: Withdrawing address record for fe80::f66d:4ff:fe3b:c24e on br0.

///// (Here's where I entered `ifup br0`)
Jan 08 22:43:30 jonathon-centos7 dhclient[5009]: DHCPDISCOVER on br0 to 255.255.255.255 port 67 interval 6 (xid=0x25f649b7)
Jan 08 22:43:31 jonathon-centos7 dhclient[5009]: DHCPREQUEST on br0 to 255.255.255.255 port 67 (xid=0x25f649b7)
Jan 08 22:43:34 jonathon-centos7 avahi-daemon[957]: Joining mDNS multicast group on interface br0.IPv4 with address 10.0.1.128.
Jan 08 22:43:34 jonathon-centos7 avahi-daemon[957]: New relevant interface br0.IPv4 for mDNS.
Jan 08 22:43:34 jonathon-centos7 avahi-daemon[957]: Registering new address record for 10.0.1.128 on br0.IPv4.
Jan 08 23:43:17 jonathon-centos7 dhclient[5124]: DHCPREQUEST on br0 to 10.0.1.1 port 67 (xid=0x25f649b7)

After the system boots, and I'm logged-in, I can open a terminal, and:

# ifup br0
set forward delay failed: Numerical result out of range

Determining IP information for br0... done.

And then I'm connected to my network.

Why am I unable to get an IP for br0 at boot?

Related:

Notes:

  • brctl showstp br0 shows that the forward delay is set to 2.00. brctl setfd br0 0 shows the same error as ifup br0. It seems that virt-manager specified an invalid DELAY=0 for br0.
  • After finding the important entries in the logs, it seems that systemd is trying to get an IP forbr0 before it has entered the forwarding state.
  • I've opened bug 8086 on the CentOS bugtracker.
  • 1
    Update: Removing STP=yes from my config allows me to win this race condition. – Jonathon Reinhart Jan 27 '15 at 9:34
1

Your bridge is not being controlled by the network initscripts, it's being controlled by libvirt. The bridge should come up when the libvirtd service comes up.

I would not run like this. I would make the bridge controlled by the network initscript, and have no bridge in the libvirt configuration.

The ifcfg- files you have now are fine. Just remove the config from libvirt, ensure you still have those files, then chkconfig network on

Yes, chkconfig works on EL7.

  • 1
    "Just remove the config from libvirt," How do I do this? Any why was virt-manager able to so easily create such a broken setup? – Jonathon Reinhart Jan 27 '15 at 9:36
1

A quote from http://www.microhowto.info/howto/persistently_bridge_traffic_between_two_or_more_ethernet_interfaces_on_redhat.html:

For this reason you may want to leave STP disabled in simple cases (such as when bridging a set of virtual machines to a single physical interface)

Disabling STP seems to be the way to get it working.

0

Your physical link is not up when your bridge starts. Add a delay to your physical interface.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.