标签:华为 三台 stat 状态 interface info 自动 eth int
一:实验环境华为ensp软件
PC机和路由器及交换机
两台初始化状态的PC机和两台初始化状态的路由器,三台交换机
SW1和SW2构成主备路由,当有一方挂掉,数据会从另外一方过 ;R1配置浮动路由
在ensp中,将PC机和路由器及交换机准备好。
[SW1]v b 10 20 100
[SW1]int g0/0/2
[SW1-GigabitEthernet0/0/2]p l t
[SW1-GigabitEthernet0/0/2]port l a v 10 20
[SW1-GigabitEthernet0/0/2]int g0/0/1
[SW1-GigabitEthernet0/0/1]p l a
[SW1-GigabitEthernet0/0/1]p t a v 100
[SW1-GigabitEthernet0/0/1]un sh
[SW1]int vlan 10
[SW1-Vlanif10]ip add 192.168.10.10 24
[SW1-Vlanif10]int vlan 20
[SW1-Vlanif20]ip add 192.168.20.10 24
[SW1-Vlanif20]int vlan 100
[SW1-Vlanif100]ip add 11.0.0.2 30
SW1的VLANIF10配置主路由与SW2的VLANIF10备路由构成主备关系;
SW1的vlanif20配置备用路由与SW2的VLANIF10主路由构成备主关系;
[SW1]int vlanif 10
[SW1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1
[SW1-Vlanif10]vrrp vrid 1 priority 120 #vrrp的优先级越大越有优先
[SW1-Vlanif10]vrrp vrid 1 track interface g0/0/1 #监听端口
[SW1-Vlanif10]vrrp vrid 1 track interface g0/0/2 #监听端口
[SW1]int vlanif 20
[SW1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[SW1-Vlanif20]vrrp vrid 2 priority 115 背用路由不用监听端口
[SW1]ip route-static 0.0.0.0 0.0.0.0 11.0.0.1
[SW2]v b 10 20 100
[SW2]int g0/0/2
[SW2-GigabitEthernet0/0/2]p l t
[SW2]int g0/0/2
[SW2-GigabitEthernet0/0/2]p l t
[SW2-GigabitEthernet0/0/2]p t a v 10 20
[SW2-GigabitEthernet0/0/2]un sh
[SW2-GigabitEthernet0/0/2]int g0/0/1
[SW2-GigabitEthernet0/0/1]p l a
[SW2-GigabitEthernet0/0/1]p d v 100
[SW2-GigabitEthernet0/0/1]un sh
[SW2]int vlanif 10
[SW2-Vlanif10]ip add 192.168.10.20 24
[SW2-Vlanif10]int vlanif 20
[SW2-Vlanif20]ip add 192.168.20.20 24
[SW2-Vlanif20]int vlanif 100
[SW2-Vlanif100]ip add 12.0.0.2 30
[SW2-Vlanif100]int vlanif 10
[SW2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1
[SW2-Vlanif10]vrrp vrid 1 priority 115 备
[SW2]int vlanif 20
[SW2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[SW2-Vlanif20]vrrp vrid 2 priority 120 主
ip route-static 0.0.0.0 0.0.0.0 12.0.0.1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 11.0.0.1 30
[R1-GigabitEthernet0/0/0]un sh
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 12.0.0.1 30
[R1-GigabitEthernet0/0/1]un sh
[R1]int loo 0
[R1-LoopBack0]ip add 1.1.1.1 24
[R1]ip route-static 192.168.10.0 255.255.255.0 11.0.0.2 #默认是60
[R1]ip route-static 192.168.10.0 255.255.255.0 12.0.0.2 preference 70 # 上面的路宕了该条路由信息会自动写进路由表,路就会飘到12.0.0.2接口上
[R1]ip route-static 192.168.20.0 255.255.255.0 12.0.0.2
[R1]ip route-static 192.168.20.0 255.255.255.0 11.0.0.2 preference 70
1.浮动路由默认是优先级是60,越小越优先,如果是第二条路由优先级是比默认的要大,一般配置60以上
标签:华为 三台 stat 状态 interface info 自动 eth int
原文地址:https://blog.51cto.com/14625831/2499329