现在用另一个接在路由器上的电脑ping这台ubuntu机器,可以同时ping通 它dhcp分配的ip和网桥设置的ip,请问这是什么原理,为甚会两个同时通?
是不是因为两个网络有重叠导致的?
网桥是通过/etc/network/interfaces设置的
代码: 全选
root@xxxx:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto enp4s0
iface enp4s0 inet dhcp
auto br0
iface br0 inet static
address 192.168.1.67
netmask 255.255.255.0
bridge_ports enp1s0 enp2s0 enp3s0
bridge_stp on
代码: 全选
root@xxxx:~# ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.67 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::202:a0ff:fe00:1093 prefixlen 64 scopeid 0x20<link>
ether 00:02:a0:00:10:93 txqueuelen 1000 (Ethernet)
RX packets 11682 bytes 136370306 (136.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10370 bytes 916239 (916.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:02:a0:00:10:93 txqueuelen 1000 (Ethernet)
RX packets 430717 bytes 164197461 (164.1 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2513125 bytes 3691381423 (3.6 GB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xd0900000-d091ffff
enp2s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 00:02:a0:00:af:d5 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xd0800000-d081ffff
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:02:a0:00:10:94 txqueuelen 1000 (Ethernet)
RX packets 2502130 bytes 3690440033 (3.6 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 339365 bytes 22333538 (22.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xd0700000-d071ffff
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.5.225 netmask 255.255.248.0 broadcast 192.168.7.255
inet6 fe80::202:a0ff:fe00:afd4 prefixlen 64 scopeid 0x20<link>
ether 00:02:a0:00:af:d4 txqueuelen 1000 (Ethernet)
RX packets 662056 bytes 89847456 (89.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 103221 bytes 21108491 (21.1 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xd0600000-d061ffff
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 149503 bytes 46187651 (46.1 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 149503 bytes 46187651 (46.1 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
代码: 全选
root@xxxx:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 enp4s0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp4s0
192.168.0.0 0.0.0.0 255.255.248.0 U 0 0 0 enp4s0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0