主机名设置
hostname BJX-03-shang
登录密码
username admin privilege 4 password admin
管理IP
management ip address 192.168.1.1/24
所有vlan
vlan database vlan 10,20,4049
业务主机端口聚合配置(服务器使用 mode 4 lacp 模式)
interface eth-0-1 switchport access vlan 101 channel-group 1 mode active interface eth-0-2 switchport access vlan 101 channel-group 2 mode active
业务主机 access 口配置
interface eth-0-43 switchport access vlan 88 interface eth-0-44 switchport access vlan 88
两台主机堆叠口配置(两台主机保持一致)
interface eth-0-49 switchport mode trunk switchport trunk allowed vlan add 111,115-134,4093 switchport trunk allowed vlan remove 1 static-channel-group 50 ! interface eth-0-50 switchport mode trunk switchport trunk allowed vlan add 111,115-134,4093 switchport trunk allowed vlan remove 1 static-channel-group 50 ! 堆叠聚合口参数 (注意要禁用掉SPT) interface agg50 switchport mode trunk switchport trunk allowed vlan add 111,115-134,4093 switchport trunk allowed vlan remove 1 spanning-tree port disable !
上级连口配置
! interface eth-0-51 switchport mode trunk switchport trunk allowed vlan add 111,115-134 switchport trunk allowed vlan remove 1 channel-group 51 mode active ! 上集联聚合口参数 interface agg51 switchport mode trunk switchport trunk allowed vlan add 111,115-134 switchport trunk allowed vlan remove 1 mlag 51
业务主机聚合参数
interface agg1 switchport access vlan 101 mlag 1 interface agg2 switchport access vlan 101 mlag 2
三层vlan (vlan 4094 是两台主机相互堆叠心跳)
interface vlan20 ip address 172.22.20.12/24 interface vlan4093 description MLAG ip address 1.1.10.2/30
主机聚合参数(两台堆叠主机相互写对方IP)
mlag configuration peer-link agg50 peer-address 1.1.10.1 exit
默认路由
ip route 0.0.0.0/0 172.22.20.254
添加虚拟IP mac地址,两台堆叠交换机 虚拟mac 要一样。
ip virtual-router mac 0000.0000.0001
业务口批量创建模版脚本
#!/bin/sh for ((i=1;i<=42;i=i+1)); #顺序口 # for ((i=1;i<=42;i=i+2)); #奇数口 # for ((i=2;i<=42;i=i+2)); #偶数口 do echo "interface eth-0-"$i""; echo "channel-group " $i " mode active"; echo "interface agg"$i""; echo "switchport mode acce "; #acces 参数 echo "switchport acc vlan 111"; #acces 参数 # echo "switchport mode trunk "; #trunk 参数 # echo "switchport trunk allowed vlan add 115-134"; #trunk 参数 echo "mlag "$i"\n"; done