实验
实验要求
路由器R1和R2上面的G0/0/0口设置子接口,使得PC1和PC2能够ping通3.3.3.3,并设置使用vrrp。
1.配置各个主机IP子网和网关
2.配置交换机SW1
<Huawei>sys
[Huawei]sys SW1
[SW1]vlan batch 10 20
[SW1]int e0/0/1
[SW1-Ethernet0/0/1]p l t
[SW1-Ethernet0/0/1]p t a v a
[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]p l t
[SW1-Ethernet0/0/2]p t a v a
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]p l a
[SW1-Ethernet0/0/3]p d v 10
[SW1-Ethernet0/0/3]int e0/0/4
[SW1-Ethernet0/0/4]p l a
[SW1-Ethernet0/0/4]p d v 20
3.配置路由器R1
<Huawei>sys
[Huawei]sys R1
[R1]vlan batch 10 20
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.10.2 24
[R1-GigabitEthernet0/0/1]int g0/0/0.1
[R1-GigabitEthernet0/0/0.1]ip add 192.168.1.252 24
[R1-GigabitEthernet0/0/0.1]d t v 10
[R1-GigabitEthernet0/0/0.1]a b e
[R1-GigabitEthernet0/0/0.1]vrrp vrid 1 virtual-ip 192.168.1.254
[R1-GigabitEthernet0/0/0.1]vrrp vrid 1 priority 110
[R1-GigabitEthernet0/0/0.1]int g0/0/0.2
[R1-GigabitEthernet0/0/0.2]ip add 192.168.2.253 24
[R1-GigabitEthernet0/0/0.2]d t v 20
[R1-GigabitEthernet0/0/0.2]a b e
[R1-GigabitEthernet0/0/0.2]vrrp vrid 2 virtual-ip 192.168.2.254
[R1-GigabitEthernet0/0/0.2]q
[R1]ip route-static 0.0.0.0 0 192.168.10.1
[R1]
4.配置路由器R2
<Huawei>sys
[Huawei]sys R2
[R2]vlan batch 10 20
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.20.2 24
[R2-GigabitEthernet0/0/1]int g0/0/0.1
[R2-GigabitEthernet0/0/0.1]ip add 192.168.1.253 24
[R2-GigabitEthernet0/0/0.1]d t v 10
[R2-GigabitEthernet0/0/0.1]a b e
[R2-GigabitEthernet0/0/0.1]vrrp vrid 1 virtual-ip 192.168.1.254
[R2-GigabitEthernet0/0/0.1]int g0/0/0.2
[R2-GigabitEthernet0/0/0.2]ip add 192.168.2.252 24
[R2-GigabitEthernet0/0/0.2]d t v 20
[R2-GigabitEthernet0/0/0.2]a b e
[R2-GigabitEthernet0/0/0.2]vrrp vrid 2 virtual-ip 192.168.2.254
[R2-GigabitEthernet0/0/0.2]vrrp vrid 2 priority 110
[R2-GigabitEthernet0/0/0.2]q
[R2]ip route-static 0.0.0.0 0 192.168.20.1
5.配置路由器R3
<Huawei>sys
[Huawei]sys R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.10.1 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.20.1 24
[R3-GigabitEthernet0/0/1]q
[R3]ip route-static 192.168.1.0 24 192.168.10.2
[R3]ip route-static 192.168.1.0 24 192.168.20.2
[R3]ip route-static 192.168.2.0 24 192.168.10.2
[R3]ip route-static 192.168.2.0 24 192.168.20.2
[R3]
[R3]int loopback0
[R3-LoopBack0]ip add 3.3.3.3 32
[R3-LoopBack0]
6.ping通测试