静态路由
华为不同路由的优先级
路由的优先级越小越优先。
浮动路由
AR1配置
interface GigabitEthernet0/0/0 ip address 12.12.12.1 255.255.255.0 # interface GigabitEthernet0/0/1 ip address 13.13.13.1 255.255.255.0 # interface GigabitEthernet0/0/2 # interface NULL0 # interface LoopBack0 ip address 1.1.1.1 255.255.255.255 # ip route-static 3.3.3.3 255.255.255.255 13.13.13.3 ip route-static 3.3.3.3 255.255.255.255 12.12.12.2 preference 80 ip route-static 23.23.23.0 255.255.255.0 13.13.13.3 ip route-static 23.23.23.0 255.255.255.0 12.12.12.2 preference 80
AR2配置
interface GigabitEthernet0/0/0 ip address 12.12.12.2 255.255.255.0 # interface GigabitEthernet0/0/1 ip address 23.23.23.2 255.255.255.0 # interface GigabitEthernet0/0/2 # interface NULL0 # interface LoopBack0 ip address 2.2.2.2 255.255.255.255 # ip route-static 3.3.3.3 255.255.255.255 23.23.23.3 #
AR3配置
interface GigabitEthernet0/0/0 ip address 23.23.23.3 255.255.255.0 # interface GigabitEthernet0/0/1 ip address 13.13.13.3 255.255.255.0 # interface GigabitEthernet0/0/2 # interface NULL0 # interface LoopBack0 ip address 3.3.3.3 255.255.255.255 # ip route-static 12.12.12.0 255.255.255.0 23.23.23.2 #
[Huawei]ping 3.3.3.3 PING 3.3.3.3: 56 data bytes, press CTRL_C to break Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=50 ms Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=255 time=10 ms Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=255 time=30 ms Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=255 time=20 ms Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=255 time=10 ms --- 3.3.3.3 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 10/24/50 ms [Huawei]tra [Huawei]tracert 3.3.3.3 traceroute to 3.3.3.3(3.3.3.3), max hops: 30 ,packet length: 40,press CTRL_C t o break 1 13.13.13.3 20 ms 20 ms 20 ms [Huawei]
去往3.3.3.3,是从13.13.13.3过去的。
关闭AR3的G0/0/1口
[Huawei]interface GigabitEthernet 0/0/1 [Huawei-GigabitEthernet0/0/1]shutdown May 14 2020 17:32:14-08:00 Huawei %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEt hernet0/0/1 has turned into DOWN state. [Huawei-GigabitEthernet0/0/1] [Huawei-GigabitEthernet0/0/1] May 14 2020 17:32:14-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the DOWN state.
[Huawei]tracert 3.3.3.3 traceroute to 3.3.3.3(3.3.3.3), max hops: 30 ,packet length: 40,press CTRL_C t o break 1 12.12.12.2 540 ms 20 ms 20 ms 2 23.23.23.3 30 ms 30 ms 30 ms
去往3.3.3.3要先经过AR2。
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。