我正在运行CentOS7。我没有在运行NetworkManager,实际上已经将其卸载。
我的系统应该br0
在启动时通过DHCP获取IPv4地址。但是,当我登录时,没有地址。
我的配置:
# 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
请注意,我没有手动配置此网桥。virt-manager
当我br0
在此对话框中添加内容时:
相关journalctl --boot | grep '\(\<br0\>\|enp5s0\)'
和上下文:
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)
系统启动并登录后,我可以打开一个终端,并:
# ifup br0
set forward delay failed: Numerical result out of range
Determining IP information for br0... done.
然后,我连接到我的网络。
为什么我br0
在启动时无法获得IP ?
有关:
- 带有dhcp的以太网桥 [CentOS形式]
笔记:
STP=yes
从我的配置中删除可以让我赢得这场比赛。