当前位置:网站首页>华为路由器如何配置静态路由
华为路由器如何配置静态路由
2022-07-06 05:43:00 【优质网络系统领域创作者】
实验目的
使用静态路由使 IP 数据可达
实验拓扑

实验步骤
1:更名及配置 IP 地址
system-view
[Huawei]sysname R1 [R1]interface Ethernet 0/0/0
[R1-Ethernet0/0/0]ip address 12.1.1.1 255.255.255.0
[R1-Ethernet0/0/0]undo shutdown
system-view
[Huawei]sysname R2
[R2]interface Ethernet 0/0/0
[R2-Ethernet0/0/0]ip address 12.1.1.2 255.255.255.0
[R2-Ethernet0/0/0]undo shutdown
[R2]interface Ethernet 0/0/1
[R2-Ethernet0/0/1]ip add
[R2-Ethernet0/0/1]ip address 23.1.1.2 255.255.255.0
[R2-Ethernet0/0/1]undo shutdown
[Huawei]sysname R3
[R3-Ethernet0/0/0]ip address 23.1.1.3 255.255.255.0
[R3-Ethernet0/0/0]undo shutdown
2:在中间路由器 R2 上测试直连是否通
[R2-Ethernet0/0/1]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=160 ms Reply from 12.1.1.1: bytes=56 Sequence=2 ttl=255 time=20 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=30 ms Reply from 12.1.1.1: bytes=56 Sequence=5 ttl=255 time=40 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/52/160 ms
[R2-Ethernet0/0/1]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=50 ms Reply from 23.1.1.3: bytes=56 Sequence=2 ttl=255 time=50 ms Reply from 23.1.1.3: bytes=56 Sequence=3 ttl=255 time=50 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 = 30/42/50 ms
3:在 R1 上直接 ping R3 将不通,需要配置一条去方向以及回来方向的配认路由
[R1-Ethernet0/0/0]ping 23.1.1.3
PING 23.1.1.3: 56 data bytes, press CTRL_C to break Request time out
在 R1 与 R3 上分别配置默认路由:
[R1]ip route-static 23.1.1.0 255.255.255.0 12.1.1.2
[R3]ip route-static 12.1.1.0 255.255.255.0 23.1.1.2
4:再测试连通性:
[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=80 ms Reply from 23.1.1.3: bytes=56 Sequence=2 ttl=254 time=70 ms Reply from 23.1.1.3: bytes=56 Sequence=3 ttl=254 time=60 ms Reply from 23.1.1.3: bytes=56 Sequence=4 ttl=254 time=40 ms Reply from 23.1.1.3: bytes=56 Sequence=5 ttl=254 time=50 ms
— 23.1.1.3 ping statistics — 5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/60/80 ms
//以上表示成功通信了。
4:还可以为一条静态路由设备优先集,也就是 CISCO 中的管理距离(AD 值),以实现浮动路由等效果。如下:
[R1]ip route-static 23.1.1.0 255.255.255.0 12.1.1.2 preference 10
请再根据 NA 的实验手册,结合这里的华为的命令,在华为的路由器上面实现浮动静态, 选择静态,汇总静态,默认静态,负载均衡的静态等效果。
查看路由表:
[R1]display ip routing
Route Flags: R - relay, D - download to fib
Routing Tables: Public
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost Flags NextHop Interface 12.1.1.0/24 Direct 0 0 D 12.1.1.1 Ethernet0/0/0
12.1.1.1/32 Direct 0 0 D 127.0.0.1 Ethernet0/0/0
23.1.1.0/24 Static 10 0 RD 12.1.1.2 Ethernet0/0/0
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
5:当想取消这条默认路由的时候,在前面打 UNDO
[R1]undo ip route-static 23.1.1.0 255.255.255.0 12.1.1.2 preference 10
边栏推荐
- 网站进行服务器迁移前应做好哪些准备?
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- AUTOSAR from getting started to becoming proficient (10) - embedded S19 file analysis
- Check the useful photo lossless magnification software on Apple computer
- Jvxetable implant j-popup with slot
- Notes, continuation, escape and other symbols
- PDK process library installation -csmc
- Huawei od computer test question 2
- 03. 开发博客项目之登录
- jdbc使用call调用存储过程报错
猜你喜欢

Easy to understand IIC protocol explanation

Remember an error in MySQL: the user specified as a definer ('mysql.infoschema '@' localhost ') does not exist

Download, install and use NVM of node, and related use of node and NRM

(column 22) typical column questions of C language: delete the specified letters in the string.

Vulhub vulnerability recurrence 73_ Webmin

Promise summary

自建DNS服务器,客户端打开网页慢,解决办法

Notes, continuation, escape and other symbols

29io stream, byte output stream continue write line feed

巨杉数据库再次亮相金交会,共建数字经济新时代
随机推荐
Station B, Master Liu Er - back propagation
Text classification still stays at Bert? The dual contrast learning framework is too strong
(column 22) typical column questions of C language: delete the specified letters in the string.
[SQL Server fast track] - authentication and establishment and management of user accounts
Vulhub vulnerability recurrence 71_ Unomi
Garbage collector with serial, throughput priority and response time priority
The digital economy has broken through the waves. Is Ltd a Web3.0 website with independent rights and interests?
Solution of QT TCP packet sticking
Deep learning -yolov5 introduction to actual combat click data set training
JS array list actual use summary
Download, install and use NVM of node, and related use of node and NRM
Web Security (V) what is a session? Why do I need a session?
05. 博客项目之安全
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
LeetCode_ String inversion_ Simple_ 557. Reverse word III in string
PDK工艺库安装-CSMC
Sequoiadb Lake warehouse integrated distributed database, June 2022 issue
Station B Liu Erden - linear regression and gradient descent
Graduation design game mall
C进阶-数据的存储(上)