一、实验拓扑
一、实验要求
1. 链路聚合
SW1与SW2配置链路聚合,要求使用LACP模式,活动链路为2条,开启抢占时间,抢占时间为20S基于源目MAC地址分担。(2分)
配置:
[S1]lacp priority 500 //设置优先级,s1为主动端
[S1]interface Eth-Trunk 10 //创建聚合组10
[S1-Eth-Trunk10]mode lacp-static //选择链路聚合模式为LACP,一定要先选择模式再配置接口,默认为手动两路聚合。
[S1-Eth-Trunk10]trunkport GigabitEthernet 0/0/23 to 0/0/24 //将接口23到24加入到聚合组10
[S2]interface Eth-Trunk 10
[S2-Eth-Trunk10]mode lacp-static
[S2-Eth-Trunk10]trunkport GigabitEthernet 0/0/23 to 0/0/24
[S1-Eth-Trunk10]lacp preempt enable //开启抢占
[S1-Eth-Trunk10]lacp preempt delay 20 //抢占时间20s
[S1-Eth-Trunk10]max active-linknumber 2 //设置最大活跃端口为2
[S1-Eth-Trunk10]Load-balance src-dst-mac 设置哈希运算为源目的ip
2. VLAN(3分)
创建VLAN10和VLAN20
在S3的连接终端为vlan10,S4的连接终端为vlan20
在SW1、SW2、SW3、SW4上互联的接口修改为Trunk类型,允许除vlan 1 外的所有VLAN通过。
配置:
[S4]vlan 20
[S4-Ethernet0/0/1]port link-type access //配置VLAN,端口类型为access
[S4-Ethernet0/0/1]port default vlan 20 //只通过vlan20的数据包
[S3]vlan 20
[S3-Ethernet0/0/1]port link-type access
[S3-Ethernet0/0/1]port default vlan 10
[S3-GigabitEthernet0/0/1]port link-type trunk
[S3-GigabitEthernet0/0/1]port trunk allow-pass vlan 2-4094
#其他交换机相连接口配置都为trunk接口与上同,略#
[S1]vlan batch 10 20 //在S1上创建vlan10 和20
[S1]undo port trunk allow-pass vlan 1 //配置不允许vlan1流量通过
[S1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2-4094 //允许vlan2-4094的流量通过
验证接口状态:
Display port vlan
#可以使用临时接口组进行配置更加高效
3. MSTP (5分)
①SW1,SW2,SW3, SW4 都运行MSTP。VLAN 10 在Instance 10,SW1作为Primary Root,SW2为Secondary Root,
②VLAN 20 在Instance 20,SW2作为Primary Root,SW1为Secondary Root,MSTP的Region-name是HUAWEI,Region-level为12。 (2分)
配置:
[S1]stp enable //全局启用stp
[S1]stp mode mstp //模式设置为mstp
[S1-GigabitEthernet0/0/2]stp edged-port enable //在S1与S2、S4、s3的边缘端口上配置为边缘端口
[S1-mst-region]
[S1-mst-region]dis th
#
stp region-configuration
region-name HUAWEI
revision-level 12
instance 10 vlan 10
instance 20 vlan 20
active region-configuration
S2、S3、S4此部分配置与上同,略
此外S1/S1在全局配置10和20实例的主备根桥。
[S2]dis th
#
sysname S2
#
stp instance 10 root secondary
stp instance 20 root primary
③除交换机互连接口,其余接口不参与MSTP计算,能够从discarding直接到Forwarding。(3分)
除备份接口外,其他接口状态均为forwarding即可
查看域的优先级
3. 安全端口
为保障网络安全,在S3,S4的连接终端的端口上开启Sticky MAC功能,最大学习数量为2条,老化时间为100秒。
设置5454-1111-1111为黑洞MAC,修改MAC地址老化时间为400S。
配置:
[S3]mac-address blackhole 5454-1111-1111 //设置黑洞mac为5454-1111-1111
[S3]mac-address aging-time 400 //配置老化时间为400s
[S3-Ethernet0/0/1]port-security enable //开启端口安全功能
[S3-Ethernet0/0/1]port-security mac-address sticky //开启Sticky MAC功能
[S3-Ethernet0/0/1]port-security max-mac-num 2 //最大学习数量为2条
[S3-Ethernet0/0/1]port-security aging-time 100 //老化时间为100秒
4. 单臂路由
在CE1上配置子接口,配置相应IP地址,开启ARP广播功能
在CE2上配置子接口,配置相应IP地址,开启ARP广播功能
[CE1]Interface GigabitEthernet0/0/2.10 //配置虚拟路由接口即单臂路由
[CE1-GigabitEthernet0/0/2.10]dot1q termination vid 10 //设置该接口对应的VLAN
[CE1-GigabitEthernet0/0/2.10]ip address 10.3.1.1 24 //配置ip地址,相当于是Vlanif10的IP地址
[CE1-GigabitEthernet0/0/2.10]arp broadcast enable //开启ARP广播功能