时光2020

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  118 随笔 :: 0 文章 :: 9 评论 :: 17万 阅读

centos7 Lacp+802.3ad配置

1.S5700交换机配置

1.1 创建Eth-Trunk

创建编号为1eth-trunk,配置他的工作模式为静态lacp模式:

 

<Quidway> system-view

[Quidway] sysname SwitchA

[SwitchA] interface eth-trunk 1

[SwitchA-Eth-Trunk1] bpdu enable

[SwitchA-Eth-Trunk1] mode lacp-static

[SwitchA-Eth-Trunk1] quit

1.2 将成员接口加入Eth-Trunk

[SwitchA] interface gigabitethernet 0/0/1

[SwitchA-GigabitEthernet0/0/1] eth-trunk 1

[SwitchA-GigabitEthernet0/0/1] quit

[SwitchA] interface gigabitethernet 0/0/2

[SwitchA-GigabitEthernet0/0/2] eth-trunk 1

[SwitchA-GigabitEthernet0/0/2] quit

1.3 验证配置结果

查看各Switch设备的Eth-Trunk信息,查看链路是否协商成功;

[SwitchA] display eth-trunk 1

Eth-Trunk1's state information is:

Local:

LAG ID: 1                 WorkingMode: STATIC

Preempt Delay: Disabled        Hash arithmetic: According to SA-XOR-DA

System Priority: 100      System ID: 00e0-fca8-0417

Least Active-linknumber: 1     Max Active-linknumber: 2

Operate status: Up             Number Of Up Port In Trunk: 2

 ------------------------------------------------------------------------------

ActorPortName        Status    PortType  PortPri   PortNo PortKey   PortState Weight

GigabitEthernet0/0/1   Selected  1GE       100      6145    2865    11111100     1

GigabitEthernet0/0/2   Selected  1GE       100      6146    2865    11111100     1

Partner:

------------------------------------------------------------------------------

PartnerPortName        SysPri    SystemID    PortPri PortNo PortKey   PortState

GigabitEthernet0/0/1   32768  00e0-fca6-7f85  32768     6145   2609     11111100

GigabitEthernet0/0/2   32768  00e0-fca6-7f85  32768     6146   2609     11111100

通过以上显示信息可以看到,SwitchA的系统优先级为100,高于SwitchB的系统优先级。Eth-Trunk的成员接口中GigabitEthernet 0/0/1GigabitEthernet 0/0/2成为活动接口,处于 Selected 状态,同时实现 M 条链路的负载分担和 N 条链路的冗余备份功能。

1.4 交换机配置文件

# sysname SwitchA

#lacp priority 100

#interface Eth-Trunk1

 mode lacp-static

 max active-linknumber 2

#interface GigabitEthernet0/0/1

 eth-trunk 1

 lacp priority  100

#interface GigabitEthernet0/0/2

 eth-trunk 1

 lacp priority  100

#interface GigabitEthernet0/0/3

 eth-trunk 1

#return

2.服务器端网卡配置

配置了 bond4 模式 ,交换机开启 lacp, 配置聚合,mode 4: lacp,802.3ad模式是IEEE标准 。

2.1 网卡em1配置

# cat /etc/sysconfig/network-scripts/ifcfg-em1

DEVICE=em1

NAME=em1

TYPE=Ethernet

BOOTPROTO=none

ONBOOT=yes

MASTER=bond0

SLAVE=yes

2.2 网卡em2配置

# cat /etc/sysconfig/network-scripts/ifcfg-em2

DEVICE=em2

NAME=em2

TYPE=Ethernet

BOOTPROTO=none

ONBOOT=yes

MASTER=bond0

SLAVE=yes

2.3 虚bond0配置

# cat /etc/sysconfig/network-scripts/ifcfg-bond4

DEVICE=bond0

NAME=bond0

TYPE=Bond

BONDING_MASTER=yes

IPADDR=172.16.32.51

GATEWAY=172.16.32.1

NETMASK=255.255.255.0

PEERDNS=yes

ONBOOT=yes

BOOTPROTO=static

BONDING_OPTS="resend_igmp=1 updelay=0 use_carrier=1 miimon=100 downdelay=0 xmit_hash_policy=layer3+4 primary_reselect=0 fail_over_mac=0 arp_validate=0 mode=802.3ad lacp_rate=1 arp_interval=0 ad_select=0"

 

2.4 bonding生效

重启系统
[root@localhost ~]# reboot

2.5 检查bonding状态

# cat /proc/net/bonding/bond4     

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation

Transmit Hash Policy: layer2 (0)

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 0

Down Delay (ms): 0

802.3ad info

LACP rate: fast

Min links: 0

Aggregator selection policy (ad_select): stable

Active Aggregator Info:

        Aggregator ID: 3

        Number of ports: 3

        Actor Key: 17

        Partner Key: 7985

        Partner Mac Address: e4:c2:d1:e5:29:40

Slave Interface: em1

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 44:a8:42:21:87:ec

Aggregator ID: 3

Slave queue ID: 0

 

Slave Interface: em2

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 44:a8:42:21:87:ed

Aggregator ID: 3

Slave queue ID: 0

posted on   时光2020  阅读(1715)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· AI Agent开发,如何调用三方的API Function,是通过提示词来发起调用的吗
点击右上角即可分享
微信分享提示