1.R1配置
<Huawei>U T M
Info: Current terminal monitor is off.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]IP address 12.1.1.1 8
2.R2配置
<Huawei>U T M
Info: Current terminal monitor is off.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 12.1.1.2 8
[R2-GigabitEthernet0/0/0]quit
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip address 23.1.1.2 8
3.R3配置
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 23.1.1.3 8
4.R1连通性测试
[R1-GigabitEthernet0/0/0]quit
[R1]ping 23.1.1.3
PING 23.1.1.3: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 23.1.1.3 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
5.R2连通性测试
[R2]ping 12.1.1.1
PING 12.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 12.1.1.1: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 12.1.1.1: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 12.1.1.1: bytes=56 Sequence=3 ttl=255 time=10 ms
Reply from 12.1.1.1: bytes=56 Sequence=4 ttl=255 time=10 ms
Reply from 12.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 12.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/22/60 ms
[R2]ping 23.1.1.3
PING 23.1.1.3: 56 data bytes, press CTRL_C to break
Reply from 23.1.1.3: bytes=56 Sequence=1 ttl=255 time=80 ms
Reply from 23.1.1.3: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 23.1.1.3: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 23.1.1.3: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 23.1.1.3: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 23.1.1.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/34/80 ms
6.R3连通性测试
[R3]ping 12.1.1.1
PING 12.1.1.1: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 12.1.1.1 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
7.R1、R3配置静态路由
[R1]ip route-static 23.1.1.0 255.0.0.0 12.1.1.2
[R3]ip route-static 12.1.1.0 8 23.1.1.2
8.R1、R3连通性测试
[R1]ping 23.1.1.3
PING 23.1.1.3: 56 data bytes, press CTRL_C to break
Reply from 23.1.1.3: bytes=56 Sequence=1 ttl=254 time=40 ms
Reply from 23.1.1.3: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 23.1.1.3: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 23.1.1.3: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 23.1.1.3: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 23.1.1.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/30/40 ms
[R3]ping 12.1.1.1
PING 12.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 12.1.1.1: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 12.1.1.1: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 12.1.1.1: bytes=56 Sequence=3 ttl=254 time=20 ms
Reply from 12.1.1.1: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 12.1.1.1: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 12.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/28/30 ms
9.查看路由表
[R3]display ip routing-table
Route Flags: R - relay, D - download to fib
Routing Tables: Public
Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost Flags NextHop Interface
12.0.0.0/8 Static 60 0 RD 23.1.1.2 GigabitEthernet0/0/1
23.0.0.0/8 Direct 0 0 D 23.1.1.3 GigabitEthernet0/0/1
23.1.1.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
23.255.255.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.修改静态路由优先级,查看路由表
[R3]ip route-static 12.1.1.0 8 23.1.1.2 preference 10
[R3]display ip routing-table
Route Flags: R - relay, D - download to fib
Routing Tables: Public
Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost Flags NextHop Interface
12.0.0.0/8 Static 10 0 RD 23.1.1.2 GigabitEthernet0/0/1
23.0.0.0/8 Direct 0 0 D 23.1.1.3 GigabitEthernet0/0/1
23.1.1.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
23.255.255.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
11.删除静态路由
[R1]undo ip route-static 23.1.1.0 255.0.0.0 12.1.1.2
Warning: The destination address and the mask do not match, and thus the static route 23.0.0.0/8 will be deleted. Continue?[Y/N]:y
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容