如果我创建一个桥接设备,然后将其设置为我的 NIC 的主设备,则两个设备似乎具有相同的 IP 和两个 mac 地址。这是正确的吗?
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
link/ether xx:xx:xx:xx:xx:25 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.16/24 brd 10.0.0.255 scope global dynamic noprefixroute eth0
valid_lft 2592sec preferred_lft 2142sec
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether xx:xx:xx:xx:xx:c1 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.16/24 brd 10.0.0.255 scope global dynamic br0
valid_lft 3370sec preferred_lft 3370sec
inet6 fe80::dea6:32ff:feaf:a125/64 scope link
valid_lft forever preferred_lft forever
4: veth1@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP group default qlen 1000
link/ether xx:xx:xx:xx:xx:c3 brd ff:ff:ff:ff:ff:ff link-netns ns1
inet 169.254.31.45/16 brd 169.254.255.255 scope global noprefixroute veth1
valid_lft forever preferred_lft forever
答案1
这不是正确的配置。桥接端口(eth0
就veth1
您的情况而言)不应具有任何 IP 地址。