首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >VLAN接口上的桥接引起广播风暴

VLAN接口上的桥接引起广播风暴
EN

Server Fault用户
提问于 2020-01-05 01:35:18
回答 1查看 1.1K关注 0票数 0

我正在我的Proxmox服务器上做实验。试验的目的是在控制工业设备的两台PC机之间建立可靠的故障通信。但我对实验的结果感到困惑。

实验1

网络布局如下:

代码语言:javascript
运行
复制
+-------------------------------------------+       
|           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
  1. SRV1是一个Debian。它有接口,ens19和ens20。ens21是为其他VM预留的。我把ens19和ens20绑在bond0上。Bond0处于广播模式。IP值为172.16.1.1的Br0是连接键0.10、键0.20和ens21的桥梁。SRV2类似于SRV1。br0的IP为172.16.1.2。

下面是我对SRV1的配置:

代码语言:javascript
运行
复制
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
  1. SW1是一个Openwrt。SW1分为四个端口(eth1~4)。我创建了两个桥梁: br-lan10超过eth1.10和eth3.30,br-lan20超过eth2.20和eth4.20。SW2类似于SW1。

/etc/config/SW1上的网络:

代码语言:javascript
运行
复制
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'
  1. 在SW1和SW2之间,可能还有其他VM充当开关。

当我从SRV1到SRV2切换时,我得到了大约40 to的延迟,并且没有收到重复的数据包:

代码语言:javascript
运行
复制
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。

实验2

我所作的更改如下:

  1. 在SRV1和SRV2上,br0超过了ens21和bond0。

/etc/SRV1上的网络/接口:

代码语言:javascript
运行
复制
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
  1. 在SW1上,br-lan10在eth1和eth3.10上,br-lan20在eth3和eth4.20上。

SW2具有类似的配置。

下面是SW1上的/etc/config/网络:

代码语言:javascript
运行
复制
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

这一次,整个系统运行良好:我得到了三个包和低延迟:

代码语言:javascript
运行
复制
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

Quesstion

在做这两个实验之前,我所期望的是:

  1. 实验1-不会发生广播风暴,因为从ens19 of SRV1到ens19 of SRV2的接口和连接都在vlan10中,而从ens20 of SRV1到ens20 of SRV2的接口和连接都在vlan20中。
  2. 实验2-将会有广播风暴,因为有一个循环( ens19@SRV1 1 -- ens19@SRV1 2 -- ens20@SRV2 - ens20@SRV1 -ens19@SRV1 1)。但我得到了相反的结果。

谁能告诉我为什么在实验1,网络广播风暴,而在实验2,没有?

非常感谢!

EN

回答 1

Server Fault用户

发布于 2020-01-07 21:14:38

也许我有点迷失在描述中..。让我试试;-)。

代码语言:javascript
运行
复制
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来消除这种情况?

祝好运。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/997649

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档