概述
客户需求:
Sw4作为客户机,创建vlan并配置地址
配置MSTP让sw1上实例10为主根,实例20为备根 sw2上实例10为备根,实例20为主根
配置VRRP使vlan10到sw1为主网关,sw2为备网关 vlan20到sw2为主网关 sw1为备网关
Sw1的上行端口DOWN掉后,vlan10到sw2为主网关
[sw1]vlan 10
[sw1-vlan10]vlan 20
[sw1]inter range g1/0/1 g1/0/2
[sw1-if-range]port link-type trunk //接口模式改为trunk
[sw1-if-range]port trunk permit vlan 10 20 //放行vlan10 vlan20
[sw1]stp region-configuration //进入MST域配置模式
[sw1-mst-region]region-name h3c //配置MST域名
[sw1-mst-region]instance 10 vlan 10 //配置实例和VLAN映射关系
[sw1-mst-region]instance 20 vlan 20 //配置实例和VLAN映射关系
[sw1-mst-region]active region-configuration //激活MST配置
[sw1]stp instance 10 root primary //配置交换机为实例的主根
[sw1]stp instance 20 root secondary //配置交换机为实例的备根
[sw2]vlan 10
[sw2-vlan10]vlan 20
[sw2]inter range g1/0/1 g1/0/2
[sw2-if-range]port link-type trunk //端口模式改为trunk
[sw2-if-range]port trunk permit vlan 10 20 //放行vlan10 vlan20
[sw2]stp region-configuration //进入MST域配置模式
[sw2-mst-region]region-name h3c //配置MST域名
[sw2-mst-region]instance 10 vlan 10 //配置实例10和VLAN10映射关系
[sw2-mst-region]instance 20 vlan 20 //配置实例20和VLAN20映射关系
[sw2-mst-region]active region-configuration //激活MST配置
[sw2]stp instance 10 root secondary //配置交换机为实例的备根
[sw2]stp instance 20 root primary //配置交换机为实例的主根
[sw3]vlan 10
[sw3-vlan10]vlan 20
[sw3]inter g1/0/3
[sw3-GigabitEthernet1/0/3]port access vlan 10 //端口模式为access并绑定vlan10
[sw3-GigabitEthernet1/0/3]inter g1/0/4
[sw3-GigabitEthernet1/0/4]port access vlan20 //端口模式为access并绑定vlan20
[sw3]inter range g1/0/1 g1/0/2
[sw3-if-range]port link-type trunk //端口改为trunk模式
[sw3-if-range]port trunk permit vlan 10 20 //放行vlan10 vlan20
[sw3]stp region-configuration //进入MST域配置模式
[sw3-mst-region]region-name h3c //配置MST域名
[sw3-mst-region]instance10 vlan 10 //配置实例10和VLAN10映射关系
[sw3-mst-region]instance 20 vlan 20 //配置实例20和VLAN20映射关系
[sw3-mst-region]active region-configuration //激活MST配置
[sw3]stp bpdu-protection //配置bpdu保护(边缘端口收到bpdu后,进入errdown,端口角色变成DP,状态变成discarding)
[sw4]undo stp global enable //关闭stp服务
[sw4]vlan 10
[sw4-vlan10]vlan 20
Qu
[sw4]inter g1/0/1
[sw4-GigabitEthernet1/0/1]port acc
[sw4-GigabitEthernet1/0/1]port access vlan10
[sw4-GigabitEthernet1/0/1]inter g1/0/2
[sw4-GigabitEthernet1/0/2]port acc
[sw4-GigabitEthernet1/0/2]port access vlan20
[sw4]inter vlan 10
[sw4-Vlan-interface10]ip add 192.168.10.124
[sw4-Vlan-interface10]inter vlan 20
[sw4-Vlan-interface20]ip add 192.168.20.124
查看mstp邻居状态 sw3的g1/0/2阻塞实例10 g1/0/1阻塞实例20
[sw1]inter vlan 10
[sw1-Vlan-interface10]ip add 192.168.10.25224
[sw1-Vlan-interface10]vrrp vrid 10 virtual-ip 192.168.10.254 //配置VRRP虚拟IP地址
[sw1-Vlan-interface10] vrrp vrid 10priority 110 //配置VRRP优先级
[sw1-Vlan-interface10]inter vlan 20
[sw1-Vlan-interface20]ip add 192.168.20.25224
[sw1-Vlan-interface20]vrrp vrid 20virtual-ip 192.168.20.254 //配置VRRP虚拟IP地址
[sw1-Vlan-interface10] vrrp vrid 20priority 90 //配置VRRP优先级
[sw2]inter vlan 10
[sw2-Vlan-interface10]ip add 192.168.10.25324
[sw2-Vlan-interface10]vrrp vrid 10virtual-ip 192.168.10.254 //配置VRRP虚拟IP地址
[sw2-Vlan-interface20]vrrpvrid 10 priority 90 //配置VRRP优先级
[sw2-Vlan-interface10]inter vlan 20
[sw2-Vlan-interface20]ip add 192.168.20.25324
[sw2-Vlan-interface20]vrrp vrid 20virtual-ip 192.168.20.254 //配置VRRP虚拟IP地址
[sw2-Vlan-interface20]vrrp vrid 20 priority110 //配置VRRP优先级
查看sw1的VRRP可以看到sw1上vlan10为主 优先级为110vlan20为备 优先级80
Sw2上vlan20为主,优先级110 vlan10为备 优先级90
如果优先级一样,先配置vrrp的为主,主备根据ip地址,地址大的优先
track
[sw1]track 1 interface GigabitEthernet1/0/3 配置接口监视
[sw1-Vlan-interface10]vrrp vrid 10 track 1priority reduced 30 VRRP中调用接口监视
Sw1上的g1/0/3接口DOWN掉,便会把vrid为10的优先级减去30,所以sw1的vrid10成为备 sw2的vrid10成为主,如果sw1的g1/0/3接口重新up,因为up前sw1的vrid10优先级大于sw2的,所以会重新成为主
最后
以上就是清脆猎豹为你收集整理的VRRP+track的全部内容,希望文章能够帮你解决VRRP+track所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复