当前位置:网站首页>Configuration of static routes (take Huawei ENSP as an example)
Configuration of static routes (take Huawei ENSP as an example)
2022-07-25 10:31:00 【m0_ fifty-four million eight hundred and three thousand seven h】
If there is a mistake , Please kindly understanding !
This article is only for my study notes , For reference only , If offended , Please contact the author for deletion !!!
Possible knowledge points :
Static routing
1. View routing table :
[r1]display ip routing-table2. Table lookup rules of routing table :
1. Recursive search
2. most ⻓ matching
3. Next ⼀ Skip writing :
[r1]ip route-static 23.1.1.0 24 12.1.1.2 It is suggested that ⽤ In the ether ⽹ Environment Unknown ⽹ paragraph Unknown ⽹ paragraph ⼦⽹ Mask Next ⼀ jump ip Address ( Connect with my local direct connection segment ⼝ Of ip Address )4. Out and out ⼝ How to write it :
[r1]ip route-static 23.1.1.0 24 s4/0/0 Out and out ⼝ How to write it It is suggested that ⽤ In the string ⾏ In link5. Summary of static routes :
[r1]ip route-static 192.168.0.0 22 12.1.1.2 Summary6. Default route :
[r3]ip route-static 0.0.0.0 0 23.1.1.17. Air connection ⼝ route :
[R3]ip route-static 192.168.0.0 22 NULL 08. Floating static routing :
ip route-static 23.1.1.0 255.255.255.0 21.1.1.2 preference 61
Experimental Topology :

One 、 First of all to PC1、PC2、PC3、PC4、PC5.PC6、PC7 To configure IP And rename six routers (r1-r6).

PC2、PC3、PC4、PC5、PC6、PC7 Follow this rule to configure
PC1:172.16.1.254/24 PC2:172.16.1.253/24 PC3:192.168.1.254/24
PC4:192.168.1.253/24 PC5:192.168.2.254/24 PC6;192.168.2.253/24
PC7:67.1.1.2/24
Two 、 by AR1-AR6 Each interface configuration of six routers IP
Take router 1 as an example , The rest are analogized according to this rule :
[r1]interface g0/0/0
[r1]ip address 16.1.1.2 255.255.255.0
[r1]interface g0/0/1
[r1]ip address 172.16.1.1 255.255.255.0
[r1]interface g0/0/2
[r1]ip address 67.1.1.1 255.255.255.0
3、 ... and 、 Use knowledge points 3 Write the next skip for each paragraph
With r6 Take router No :
[r6]ip route-static 12.1.1.0 24 16.1.1.2
[r6]ip route-static 21.1.1.0 24 16.1.1.2 preference 61
[r6]ip route-static 24.1.1.0 24 16.1.1.2
[r6]ip route-static 45.1.1.0 24 16.1.1.2
[r6]ip route-static 192.168.0.0 22 16.1.1.2 The difference here is , In order to achieve PC1 visit PC345 Go up there ,R1-R2 Enable backup ,21.1.1.0/24 Enable backup , To be in 21.1.1.0/24 Segment set priority to 61, and 192.168.1.0/24 and 192.168.2.0/24 To achieve summary ( Use the above knowledge points five ), So for 192.168.0.0/22. Other routers are configured according to the above rules .
Four 、 To achieve PC3、4、5、6 Visiting room PC1、2 Go down R3 4 Realize equivalent routing between , Try to reduce the number of routing entries. The whole network can reach , So write for each paragraph 192.168.0.0/22 Next jump of , In order to achieve the effect of repacking .
[r5]ip route-static 192.168.0.0 22 45.1.1.1
[r4]ip route-static 192.168.0.0 22 34.1.1.1
[r4]ip route-static 192.168.0.0 22 43.1.1.1
[r3]ip route-static 192.168.0.0 22 13.1.1.1
[r1]ip route-static 192.168.0.0 22 16.1.1.15、 ... and 、 In order to achieve R7 On behalf of the operator all pc You can visit , Use your knowledge 6 Implement the default route for each segment .
[r5]ip route-static 0.0.0.0 0 45.1.1.1
[r4]ip route-static 0.0.0.0 0 34.1.1.1
[r4]ip route-static 0.0.0.0 0 43.1.1.1
[r3]ip route-static 0.0.0.0 0 13.1.1.1
[r1]ip route-static 0.0.0.0 0 16.1.1.16、 ... and 、 Check the routing table .
With r5 Take router No
<r5>display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 17 Routes : 17
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 45.1.1.1 GigabitEthernet
0/0/0
34.1.1.0/24 Static 60 0 RD 45.1.1.1 GigabitEthernet
0/0/0
43.1.1.0/24 Static 60 0 RD 45.1.1.1 GigabitEthernet
0/0/0
45.1.1.0/24 Direct 0 0 D 45.1.1.2 GigabitEthernet
0/0/0
45.1.1.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
45.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/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
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.16.1.0/24 Static 60 0 RD 45.1.1.1 GigabitEthernet
0/0/0
192.168.1.0/24 Direct 0 0 D 192.168.1.1 GigabitEthernet
0/0/1
192.168.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.2.0/24 Direct 0 0 D 192.168.2.1 GigabitEthernet
0/0/2
192.168.2.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.2.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0According to the above table, the default route 0/0/0 My next jump is 45.1.1.1, In line with the question , And include all routing entries known to the subject .
7、 ... and 、 Test if PC You can visit .
1. First test PC1 and PC2、PC3 and PC4、PC5 and PC6, Whether the same network segment is interconnected .
With PC1 ping PC2 For example :
PC>ping 172.16.1.253
Ping 172.16.1.253: 32 data bytes, Press Ctrl_C to break
From 172.16.1.253: bytes=32 seq=1 ttl=128 time=46 ms
From 172.16.1.253: bytes=32 seq=2 ttl=128 time=32 ms
From 172.16.1.253: bytes=32 seq=3 ttl=128 time=31 ms
From 172.16.1.253: bytes=32 seq=4 ttl=128 time=31 ms
From 172.16.1.253: bytes=32 seq=5 ttl=128 time=31 ms
--- 172.16.1.253 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/34/46 ms
The result is shown in Fig. :

The other two results are the same as above , So don't show .
2. testing 172.16.1.0/24 Paragraph and 192.168.0.0 Whether the segments are interconnected .
With PC1 ping PC6 For example :
PC>ping 192.168.2.253
Ping 192.168.2.253: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.253: bytes=32 seq=2 ttl=123 time=109 ms
From 192.168.2.253: bytes=32 seq=3 ttl=123 time=79 ms
From 192.168.2.253: bytes=32 seq=4 ttl=123 time=93 ms
From 192.168.2.253: bytes=32 seq=5 ttl=123 time=94 ms
--- 192.168.2.253 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/93/109 msThe result is shown in Fig. :

3.PC7 On behalf of the operator , use PC1-PC6 Test connectivity .
With PC6 ping PC7 For example :
PC>ping 67.1.1.2
Ping 67.1.1.2: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 67.1.1.2: bytes=32 seq=2 ttl=123 time=63 ms
From 67.1.1.2: bytes=32 seq=3 ttl=123 time=47 ms
From 67.1.1.2: bytes=32 seq=4 ttl=123 time=47 ms
From 67.1.1.2: bytes=32 seq=5 ttl=123 time=46 ms
--- 67.1.1.2 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/50/63 ms
The result is shown in Fig. :

in summary , According to the requirements of the experiment , To complete the steps .
Experiment link is attached :https://pan.baidu.com/s/14lVPOkzkrkgbyElX2JSUWw Extraction code :73s7
If there is a mistake , Please contact the author for deletion , And ask friends in the industry to correct , Thank you very much !
边栏推荐
- Number theory -- negative Radix conversion
- Open virtual private line network load balancing
- When installing mysql, string the service installation failure > mysql80 startup failure
- Angr (VII) -- angr_ ctf
- Array static initialization, traversal, maximum value
- 9.shell文本处理三剑客之awk
- 6.shell之正则表达式
- 虚拟专线网络部署
- Attention is all you need 论文精读笔记 Transformer
- 搭建LNMP+DISCUZ论坛
猜你喜欢
随机推荐
Set creation and common methods
Erlang(离线部署)
Number theory -- Research on divisor
Swing的组件图标
一、unittest框架和pytest框架的区别
Angr(三)——angr_ctf
数组静态初始化,遍历,最值
Angr(七)——angr_ctf
Reproduce asvspoof 2021 baseline rawnet2
存储、计算、分布式虚拟化篇(收集整理适合小白)
Storage, computing and distributed computing (collection and sorting is suitable for Xiaobai)
6. Regular expression of shell
Set up lnmp+discuz Forum
CONDA configures the deep learning environment pytorch transformers
SQL topic sorting
4、 Testfixture test fixture, or test firmware
Angr (VII) -- angr_ ctf
Multithreading - five states
When installing mysql, string the service installation failure > mysql80 startup failure
1.Shell编程规范与变量









