网桥二层协议隧道

A VXLAN 在三层结构上连接二层域;但是,二层协议数据包,例如 LLDPLACPSTPCDP 在入口 VTEP 处停止。如果您希望 VXLAN 的行为更像电线或集线器,交换机隧道传输协议数据包而不是在本地终止它们,您可以启用网桥二层协议隧道

配置网桥二层协议隧道

配置所有协议的网桥二层协议隧道

Cumulus Linux 没有为此设置提供 NVUE 命令。

bridge-l2protocol-tunnel all 添加到 /etc/network/interfaces 文件的接口节和 VNI 节

cumulus@switch:~$ sudo nano /etc/network/interfaces
...
auto swp1
iface swp1
    bridge-access 10
    bridge-l2protocol-tunnel all

auto swp2
iface swp2

auto swp3
iface swp3

auto swp4
iface swp4
...
interface vni10
    bridge-access 10
    bridge-l2protocol-tunnel all
    bridge-learning off
    mstpctl-bpduguard yes
    mstpctl-portbpdufilter yes
    vxlan-id 10
    vxlan-local-tunnelip 10.10.10.1

为特定协议(例如 LACP)配置网桥二层协议隧道

Cumulus Linux 没有为此配置提供 NVUE 命令。

bridge-l2protocol-tunnel <protocol> 添加到 /etc/network/interfaces 文件的接口节和 VNI 节

cumulus@switch:~$ sudo nano /etc/network/interfaces
...
auto swp1
iface swp1
    bridge-access 10
    bridge-l2protocol-tunnel lacp

auto swp2
iface swp2

auto swp3
iface swp3

auto swp4
iface swp4
...
interface vni10
    bridge-access 10
    bridge-l2protocol-tunnel lacp
    bridge-learning off
    mstpctl-bpduguard yes
    mstpctl-portbpdufilter yes
    vxlan-id 10
    vxlan-local-tunnelip 10.10.10.1

除了接口之外,您还必须在 VXLAN 链路上启用二层协议隧道,以便数据包被正确桥接和转发。

LLDP 示例

这是链路层发现协议的另一个配置示例。您可以使用 lldpcli 验证配置。

cumulus@switch:~$ sudo lldpcli show neighbors
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface: swp23, via LLDP, RID: 13, TIme: 0 day, 00:58:20
  Chassis:
    ChassisID: mac e4:1d:2d:f7:d5:52
    SysName: H1
    MgmtIP: 10.0.2.207
    MgmtIP: fe80::e61d:2dff:fef7:d552
    Capability: Bridge, off
    Capability: Router, on
  Port:
    PortID: ifname swp14
    PortDesc: swp14
    TTL: 120
    PMD autoneg: support: yes, enabled: yes
      Adv: 1000Base-T, HD: no, FD: yes
      MAU oper type: 40GbaseCR4 - 40GBASE-R PCS/PMA over 4 lane shielded copper balanced cable
...

LACP 示例

H2 bond0:
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer 3+4(1)

802.3ad: info
LACP rate: fast
Min links: 1
Aggregator selection policy (ad_select): stable
System priority: 65535
System MAC address: cc:37:ab:e7:b5:7e
Active Aggregator Info:
    Aggregator ID: 1
    Number of ports: 2

Slave Interface: eth0
...
details partner lacp pdu:
    system priority: 65535
    system MAC address: 44:38:39:00:a4:95
...
Slave Interface: eth1
...
details partner lacp pdu:
    system priority: 65535
    system MAC address: 44:38:39:00:a4:95

伪线示例

在此示例中

  • VXLAN 中只有两个 VTEP。VTEP1 和 VTEP2 相互指向作为唯一的远程 VTEP。
  • 每个 VTEP 上的网桥都处于 802.1ad 模式。
  • 主机接口是 802.1Q VLAN trunk。
  • bridge-l2protocol-tunnel 的设置为 all
  • VTEP 面向主机的端口处于访问模式,PVID 映射到 VNI。

注意事项

启用网桥二层协议隧道时请谨慎

  • 二层协议隧道不是全功能的伪线解决方案;不存在端到端链路状态跟踪或反馈。
  • 二层协议通常在链路本地范围内运行。通过三层结构上的隧道运行协议会产生更高的延迟,这需要您调整协议计时器。
  • 缺少端到端链路或隧道状态反馈以及更高的协议超时值会导致在发生更改时协议收敛时间更长。
  • 如果远程端点是使用 LACP 的 Cisco 端点,则必须在 Cisco 设备上配置 etherchannel misconfig guard