1、实现全网互通
2、对SW1与SW2配置VRRP,实现在上行链路端口故障时流量能够实现自动切换
1、配置2台PC机的地址
2、在SW3上进行如下配置:
sy
[Huawei]sy SW3
[SW3]vlan batch 10 20
[SW3]interface Ethernet 0/0/1
[SW3-Ethernet0/0/1]port link-type access
[SW3-Ethernet0/0/1]port default vlan 10
[SW3-Ethernet0/0/1]interface Ethernet0/0/3
[SW3-Ethernet0/0/3]port link-type access
[SW3-Ethernet0/0/3]port default vlan 20
[SW3-Ethernet0/0/3]interface Ethernet0/0/2
[SW3-Ethernet0/0/2]port link-type trunk
[SW3-Ethernet0/0/2]port trunk allow-pass vlan all
[SW3-Ethernet0/0/2]interface Ethernet0/0/4
[SW3-Ethernet0/0/4]port link-type trunk
[SW3-Ethernet0/0/4]port trunk allow-pass vlan all
3、在SW1上进行如下配置:
sy
[Huawei]sy SW1
[SW1]vlan batch 10 20 100
[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type trunk
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW1]interface vlanif 10
[SW1-Vlanif10]ip address 192.168.10.10 24
[SW1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1
[SW1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1
[SW1-Vlanif10]vrrp vrid 1 priority 105
[SW1-Vlanif10]vrrp vrid 1 track interface GigabitEthernet 0/0/1
[SW1-Vlanif10]interface vlanif 20
[SW1-Vlanif20]ip address 192.168.20.20 24
[SW1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[SW1-Vlanif20]vrrp vrid 2 track interface GigabitEthernet 0/0/1
4、在SW2上进行如下配置:
sy
[Huawei]sy SW2
[SW2]vlan batch 10 20 200
[SW2]interface GigabitEthernet 0/0/2
[SW2-GigabitEthernet0/0/2]port link-type trunk
[SW2-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW2-GigabitEthernet0/0/2]interface vlanif 10
[SW2-Vlanif10]ip address 192.168.10.11 24
[SW2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1
[SW2-Vlanif10]interface vlanif 20
[SW2-Vlanif20]ip address 192.168.20.11 24
[SW2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[SW2-Vlanif20]vrrp vrid 2 priority 105
[SW2-Vlanif20]vrrp vrid 2 track interface GigabitEthernet 0/0/1
5、在SW1上进行如下配置:
[SW1-Vlanif20]int GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 100
[SW1-GigabitEthernet0/0/1]interface vlanif 100
[SW1-Vlanif100]ip address 10.10.10.1 24
6、在SW2上进行如下配置:
[SW2-Vlanif20]interface GigabitEthernet 0/0/1
[SW2-GigabitEthernet0/0/1]port link-type access
[SW2-GigabitEthernet0/0/1]port default vlan 200
[SW2-GigabitEthernet0/0/1]interface vlanif 200
[SW2-Vlanif200]ip address 20.20.20.1 24
7、在AR1上进行如下配置:
sy
[Huawei]sy R1
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.10.10.2 24
[R1-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1]ip address 20.20.20.2 24
[R1-GigabitEthernet0/0/1]quit
[R1]ip route-static 192.168.10.0 24 10.10.10.1
[R1]ip route-static 192.168.10.0 24 20.20.20.1 preference 70
[R1]ip route-static 192.168.20.0 24 20.20.20.1
[R1]ip route-static 192.168.20.0 24 10.10.10.1 preference 70
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 1.1.1.1 32
8、因为在AR1上配置了回环口,所以要在SW1上配置静态路由:
[SW1-Vlanif100]quit
[SW1]ip route-static 1.1.1.1 32 10.10.10.2
9、因为在AR1上配置了回环口,所以也要在SW2上配置静态路由:
[SW2-Vlanif200]quit
[SW2]ip route-static 1.1.1.1 32 20.20.20.2
到这一步配置就完成了,现在我们在PC1上追踪一下到AR1的数据流向:
现在将SW1上g0/0/1接口down掉模拟故障发生,看流量是否可以自动切换
再次追踪一下PC1到AR1环回口的数据流向: