我正在我的Proxmox服务器上做实验。试验的目的是在控制工业设备的两台PC机之间建立可靠的故障通信。但我对实验的结果感到困惑。
网络布局如下:
+-------------------------------------------+
| ens21 x | SRV1
| | | 172.16.1.2
| br0 |
| | |
|bond0.10. * - - - + - - - - - * bond0.20|
| | | |
| ens19 x...................x ens20 |
+-------------------------------------------+
| |
vlan10 | | vlan20
| |
+-------------------------------------------+
| eth3.10 x x eth4.20 | SW1
| |
| eth1.10 x x eth2.20 |
+-------------------------------------------+
| |
| |
other |
vlan10 bridges | vlan20
or |
switches |
| |
+-------------------------------------------+
| eth3.10 x x| eth4.20 | SW2
| |
| eth1.10 x eth2 x eth3.20 |
+-------------------------------------------+
| |
vlan10 | | vlan20
| |
+-------------------------------------------+ SRV2
| ens19 ...................x ens20 | 172.16.1.1
| | | |
|bond0.10. * - - - + - - - - - * bond0.20|
| | |
| br0 |
| | |
| ens21 x |
+-------------------------------------------+
Note:
x: NIC
*: Bonding interface
....: Bonding connection
- or | seperated by space: Bridging connection下面是我对SRV1的配置:
auto bond0
iface bond0 inet manual
up ifconfig $IFACE promisc
up ifconfig bond0 0.0.0.0 up
bond-slaves ens19 ens20
#bond-miimon 100
bond-downdelay 200
bond-updelay 200
#arp_interval 100
#arp_ip_target 172.16.1.2
#bond-mode active-backup
bond-mode broadcast
#bond-mode balance-alb
#pre-up echo 100 > /sys/class/net/bond0/bonding/arp_interval
#pre-up echo +172.16.1.2 > /sys/class/net/bond0/bonding/arp_ip_target
auto bond0.10
iface bond0.10 inet manual
#iface bond0.10 inet static
# address 192.168.100.11
# netmask 2558.255.255.0
# vlan-raw_device bond0
auto bond0.20
iface bond0.20 inet manual
#iface bond0.20 inet static
# address 192.168.200.12
# netmask 255.255.255.0
# vlan-raw_device bond0
auto ens21
iface ens21 inet manual
up ifconfig $IFACE promisc
auto br0
iface br0 inet static
#bridge_ports bond0 ens21
bridge_ports bond0.10 bond0.20 ens21
address 172.16.1.1
broadcast 172.16.255.255
netmask 16
bridge_stp off
bridge_fd 0/etc/config/SW1上的网络:
config interface 'eth1_10'
option proto 'none'
option ifname 'eth1.10'
option auto '1'
config interface 'eth2_20'
option proto 'none'
option ifname 'eth2.20'
option auto '1'
config interface 'eth3_10'
option proto 'none'
option ifname 'eth3.10'
option auto '1'
config interface 'eth4_20'
option proto 'none'
option ifname 'eth4.20'
option auto '1'
config interface 'lan10'
option proto 'static'
option type 'bridge'
option ifname 'eth1.10 eth3.10'
config interface 'lan20'
option type 'bridge'
option proto 'none'
option auto '1'
option ifname 'eth2.20 eth4.20'当我从SRV1到SRV2切换时,我得到了大约40 to的延迟,并且没有收到重复的数据包:
root@SRV1:~# ping 172.16.1.2 -c 5
PING 172.16.1.2 (172.16.1.2) 56(84) bytes of data.
64 bytes from 172.16.1.2: icmp_seq=1 ttl=64 time=37.7 ms
64 bytes from 172.16.1.2: icmp_seq=2 ttl=64 time=44.0 ms
64 bytes from 172.16.1.2: icmp_seq=3 ttl=64 time=36.9 ms
64 bytes from 172.16.1.2: icmp_seq=4 ttl=64 time=46.1 ms
64 bytes from 172.16.1.2: icmp_seq=5 ttl=64 time=45.8 ms
--- 172.16.1.2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 14ms
rtt min/avg/max/mdev = 36.864/42.085/46.071/3.986 ms我还发现,PROXMOX和SRV1的CPU使用率分别为98%和86%。所监测的流量从4KB迅速增加到大约120 4KB。
我所作的更改如下:
/etc/SRV1上的网络/接口:
auto br0
iface br0 inet static
bridge_ports bond0 ens21
#bridge_ports bond0.10 bond0.20 ens21
address 172.16.1.1
broadcast 172.16.255.255
netmask 16
bridge_stp off
bridge_fd 0SW2具有类似的配置。
下面是SW1上的/etc/config/网络:
config interface 'lan10'
option proto 'static'
option type 'bridge'
option ifname 'eth1 eth3.10'
config interface 'lan20'
option type 'bridge'
option proto 'none'
option auto '1'
option ifname 'eth2 eth4.20这一次,整个系统运行良好:我得到了三个包和低延迟:
root@SRV1:~# ping 172.16.1.2 -c 5
PING 172.16.1.2 (172.16.1.2) 56(84) bytes of data.
64 bytes from 172.16.1.2: icmp_seq=1 ttl=64 time=0.989 ms
64 bytes from 172.16.1.2: icmp_seq=1 ttl=64 time=1.00 ms (DUP!)
64 bytes from 172.16.1.2: icmp_seq=1 ttl=64 time=1.05 ms (DUP!)
64 bytes from 172.16.1.2: icmp_seq=1 ttl=64 time=1.06 ms (DUP!)
64 bytes from 172.16.1.2: icmp_seq=5 ttl=64 time=0.825 ms
--- 172.16.1.2 ping statistics ---
5 packets transmitted, 5 received, +12 duplicates, 0% packet loss, time 10ms
rtt min/avg/max/mdev = 0.811/1.022/1.310/0.143 ms在做这两个实验之前,我所期望的是:
谁能告诉我为什么在实验1,网络广播风暴,而在实验2,没有?
非常感谢!
发布于 2020-01-07 21:14:38
也许我有点迷失在描述中..。让我试试;-)。
SRV1/ens19 is access VLAN 10 on switch (untagged)
SRV1/ens20 is access VLAN 20 on switch (untagged)您正在通过具有不同设置的连接/端口创建连接接口。在我看来..。就说不平常吧。在它旁边,一旦你建立了这个纽带,你就把VLAN连接在一起.我不知道你到底想做什么。您在逻辑上对VLAN进行修补并创建循环。
我会考虑在交换机上的端口上设置主干,并在端口上标记VLAN和相同的配置。然后在这些港口上建立联系。然后你可以玩键0.10和键0.20。
顺便说一句。如果你把桥两端都有很好的逻辑循环-你确定你想要这种设置吗?是否有适当的STP来消除这种情况?
祝好运。
https://serverfault.com/questions/997649
复制相似问题