华为数通 vrrp、mstp实验案例-1

华为数通 vrrp、mstp实验案例-1

配置信息不分前后顺序,仅复制设备配置文件中的信息整理

SW1:
[SW1]vlan batch 10 20 30 40
#
[SW1]stp region-configuration    # 进入stp配置模式
     region-name mstp    # 配置mstp域名,保持二层都在同一个域名下
     revision-level 1    # 配置修订等级
     instance 10 vlan 10 20 40    # 配置vlan所属实例
     instance 20 vlan 30
     active region-configuration
#
[SW1]interface Ethernet0/0/1
     port link-type access
     port default vlan 10
     stp bpdu-filter enable
#
[SW1]interface Ethernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW1]interface Ethernet0/0/3
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
SW2:
[SW2]vlan batch 10 20 30 40
#
[SW2]stp region-configuration
     region-name mstp
     revision-level 1
     instance 10 vlan 10 20 40
     instance 20 vlan 30
     active region-configuration
#
[SW2]interface Ethernet0/0/1
     port link-type access
     port default vlan 20
     stp bpdu-filter enable
#
[SW2]interface Ethernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW2]interface Ethernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
SW3:
[SW3]vlan batch 10 20 30 40
#
[SW3]stp region-configuration
     region-name mstp
     revision-level 1
     instance 10 vlan 10 20 40
     instance 20 vlan 30
     active region-configuration
#
[SW3]interface Ethernet0/0/1
     port link-type access
     port default vlan 30
     stp bpdu-filter enable
#
[SW3]interface Ethernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW3]interface Ethernet0/0/3
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
SW4:
[SW4]dhcp enable    # 开启dhcp服务
[SW4]vlan batch 10 20 30 40 50    # 批量创建vlan
#
[SW4]stp instance 0 priority 0    # 配置默认实例0优先级为0最高优先,未划分实例的其他流量均走SW4
[SW4]stp instance 10 priority 0    # 配置实例10优先级为0最高优先
[SW4]stp instance 20 priority 4096    # 配置实例20优先级为4096次优先(优先级为4096的倍数)
#
[SW4]stp region-configuration     # 进入stp配置
     region-name mstp    # 配置mstp域名为mstp
     revision-level 1    # 配置修订等级,主要的作用是设备属于的mstp域。
     instance 10 vlan 10 20 40    # vlan10 20 40划分实例10
     instance 20 vlan 30    # vlan40划分实例20
     active region-configuration    # 激活mstp配置
#
[SW4]interface Vlanif10
     ip address 10.0.1.4 255.255.255.0
     vrrp vrid 10 virtual-ip 10.0.1.254    # 配置vrrp虚拟ip地址
     vrrp vrid 10 priority 101    # 配置该vrid10的优先级为101,默认优先级为100,越大越优先
     vrrp vrid 10 preempt-mode timer delay 1    # 配置vrid10的抢占时间为1秒
     dhcp select relay    # 配置dhcp中继
     dhcp relay server-ip 10.0.4.100    # 配置dhcp中继服务器ip地址
#
[SW4]interface Vlanif20
     ip address 10.0.2.4 255.255.255.0
     vrrp vrid 20 virtual-ip 10.0.2.254
     vrrp vrid 20 priority 101
     vrrp vrid 20 preempt-mode timer delay 1
     dhcp select relay
     dhcp relay server-ip 10.0.4.100
#
[SW4]interface Vlanif30
     ip address 10.0.3.4 255.255.255.0
     vrrp vrid 30 virtual-ip 10.0.3.254    # 配置Vrid30的虚拟ip地址
     ospf cost 50    # ospf引入修改cost为50,避免次优路由,让ar1去往vlan30网段的流量走sw5
     dhcp select relay
     dhcp relay server-ip 10.0.4.100
#
[SW4]interface Vlanif40
     ip address 10.0.4.4 255.255.255.0
     vrrp vrid 40 virtual-ip 10.0.4.254
     vrrp vrid 40 priority 101
     vrrp vrid 40 preempt-mode timer delay 1
#
[SW4]interface Vlanif50
     ip address 11.0.0.4 255.255.255.0
#
[SW4]interface Eth-Trunk0
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW4]interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW4]interface GigabitEthernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW4]interface GigabitEthernet0/0/3
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW4]interface GigabitEthernet0/0/4
     port link-type access
     port default vlan 50
#
[SW4]interface GigabitEthernet0/0/5
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW4]interface GigabitEthernet0/0/23
     eth-trunk 0    # 配置加入eth-trunk0
#
[SW4]interface GigabitEthernet0/0/24
     eth-trunk 0
[SW4]ospf 1 router-id 4.4.4.4
      area 0.0.0.0
       network 11.0.0.0 0.0.0.255
       network 10.0.1.0 0.0.0.255
       network 10.0.2.0 0.0.0.255
       network 10.0.3.0 0.0.0.255
       network 10.0.4.0 0.0.0.255
#
[SW4]ip route-static 0.0.0.0 0.0.0.0 11.0.0.1
SW5:
[SW5]dhcp enable
[SW5]vlan batch 10 20 30 40 60
#
[SW5]stp instance 0 priority 4096
[SW5]stp instance 10 priority 4096
[SW5]stp instance 20 priority 0
#
[SW5]stp region-configuration
     region-name mstp
     revision-level 1
     instance 10 vlan 10 20 40
     instance 20 vlan 30
     active region-configuration
#
[SW5]interface Vlanif10
     ip address 10.0.1.5 255.255.255.0
     vrrp vrid 10 virtual-ip 10.0.1.254
     ospf cost 50
     dhcp select relay
     dhcp relay server-ip 10.0.4.100
#
[SW5]interface Vlanif20
     ip address 10.0.2.5 255.255.255.0
     vrrp vrid 20 virtual-ip 10.0.2.254
     ospf cost 50
     dhcp select relay
     dhcp relay server-ip 10.0.4.100
#
[SW5]interface Vlanif30
     ip address 10.0.3.5 255.255.255.0
     vrrp vrid 30 virtual-ip 10.0.3.254
     vrrp vrid 30 priority 101
     vrrp vrid 30 preempt-mode timer delay 1
     dhcp select relay
     dhcp relay server-ip 10.0.4.100
#
[SW5]interface Vlanif40
     ip address 10.0.4.5 255.255.255.0
     vrrp vrid 40 virtual-ip 10.0.4.254
     ospf cost 50
#
[SW5]interface Vlanif60
     ip address 12.0.0.5 255.255.255.0
#
[SW5]interface Eth-Trunk0
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW5]interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW5]interface GigabitEthernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW5]interface GigabitEthernet0/0/3
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW5]interface GigabitEthernet0/0/4
     port link-type access
     port default vlan 60
#
[SW5]interface GigabitEthernet0/0/5
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW5]interface GigabitEthernet0/0/23
     eth-trunk 0
#
[SW5]interface GigabitEthernet0/0/24
     eth-trunk 0
#
[SW5]ospf 1 router-id 5.5.5.5
      area 0.0.0.0
       network 12.0.0.0 0.0.0.255
       network 10.0.1.0 0.0.0.255
       network 10.0.2.0 0.0.0.255
       network 10.0.3.0 0.0.0.255
       network 10.0.4.0 0.0.0.255
#
[SW5]ip route-static 0.0.0.0 0.0.0.0 12.0.0.1
SW6:
[SW6]vlan batch 10 20 30 40
#
[SW6]stp region-configuration
     region-name mstp
     revision-level 1
     instance 10 vlan 10 20 40
     instance 20 vlan 30
     active region-configuration
#
[SW6]interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW6]interface GigabitEthernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 2 to 4094
#
[SW6]interface GigabitEthernet0/0/3
     port link-type access
     port default vlan 40
#
[SW6]interface GigabitEthernet0/0/4
     port link-type access
     port default vlan 40
AR4:
[AR4]dhcp enable
#
[AR4]ip pool vlan10    # 配置vlan10的地址池
     gateway-list 10.0.1.254 
     network 10.0.1.0 mask 255.255.255.0 
#
[AR4]ip pool vlan20
     gateway-list 10.0.2.254 
     network 10.0.2.0 mask 255.255.255.0 
#
[AR4]ip pool vlan30
     gateway-list 10.0.3.254 
     network 10.0.3.0 mask 255.255.255.0 
#
[AR4]interface GigabitEthernet0/0/0
     ip address 10.0.4.100 255.255.255.0 
     dhcp select global
[AR4]ip route-static 0.0.0.0 0.0.0.0 10.0.4.254
AR1:
[AR1]interface GigabitEthernet0/0/0
     ip address 11.0.0.1 255.255.255.0 
#
[AR1]interface GigabitEthernet0/0/1
     ip address 12.0.0.1 255.255.255.0 
#
[AR1]interface GigabitEthernet4/0/0
     ip address 20.0.0.1 255.255.255.0 
#
[AR1]ospf 1 router-id 1.1.1.1 
      area 0.0.0.0 
       network 11.0.0.0 0.0.0.255 
       network 12.0.0.0 0.0.0.255 
#
[AR1]ip route-static 0.0.0.0 0.0.0.0 20.0.0.2
AR2:
[AR2]interface GigabitEthernet0/0/0
     ip address 20.0.0.2 255.255.255.0 
#
[AR2]interface LoopBack1
     ip address 114.114.114.114 255.255.255.255 
#
[AR2]ip route-static 0.0.0.0 0.0.0.0 20.0.0.1

作者:Zleoco,如若转载,请注明出处:https://www.zleoco.com/?p=1870

发表回复

您的电子邮箱地址不会被公开。