当前位置:网站首页>HCIA-R&S自用笔记(17)OSPF实验与路由综合实验
HCIA-R&S自用笔记(17)OSPF实验与路由综合实验
2022-07-22 01:23:00 【筐瓢大师小吕】
OSPF实验
①配置主机名与地址(只列出R1)
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]int gi0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.0.1 24
②③④开启OSPF进程并配置Rid(以R1为例,R2接口优先级低于R1)
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]qu
[R1]int GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ospf dr-priority 200
验证R1是否成为DR,如下,已经成为DR
[R1-ospf-1]dis ospf interface GigabitEthernet 0/0/0
OSPF Process 1 with Router ID 1.1.1.1
Interfaces
Interface: 192.168.0.1 (GigabitEthernet0/0/0)
Cost: 1 State: DR Type: Broadcast MTU: 1500
Priority: 200
Designated Router: 192.168.0.1
Backup Designated Router: 192.168.0.2
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
⑤R3与R4之间启用MD5类型(仅列出R3)
[R3]int Serial 4/0/0
[R3-Serial4/0/0]ospf authentication-mode md5 1 cipher ayanami
⑥验证R1至4.4.4.4的开销,如下,为49
[R1]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost Flags NextHop Interface
4.4.4.4/32 OSPF 10 49 D 192.168.0.3 GigabitEthernet
0/0/0
34.0.0.0/8 OSPF 10 49 D 192.168.0.3 GigabitEthernet
0/0/0
---- More ----
在R1的出接口Gi0/0/0上查看开销,在R3的S4/0/0查看开销,相加为49(仅列出R4)
[R3]dis ospf int Serial 4/0/0
OSPF Process 1 with Router ID 3.3.3.3
Interfaces
Interface: 34.0.0.3 (Serial4/0/0) --> 34.0.0.4
Cost: 48 State: P-2-P Type: P2P MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
R1的Gi 0/0/0开销为1,R3的S 4/0/0开销为48,相加为49
⑦⑧R8模拟运营商网络
R8为运营商网络,说明R4仅有一条至R8的静态或缺省路由
[R4]ip route-static 0.0.0.0 0 48.0.0.8
注意,R8(运营商)在这里要有一条回程的缺省路由(实际在生产环境中是不太可能的)
[R8]ip route-static 0.0.0.0 0.0.0.0 48.0.0.4
此时ASBR(R4)发布OSPF默认路由即可实现全网通
[R4]ospf 1
[R4-ospf-1]default-route-advertise
注:若R8没有缺省路由,R4发布OSPF默认路由也实现不了全网通(缺乏回程路由),此时可以通过注入直连路由实现全网通(实验得出)
路由综合实验(7/21,21min)
略去接口地址配置及RIP、OSPF宣告配置(OSPF Router id为x.x.x.x,即R4为4.4.4.4,依次列推)
R1、R2、R4只能配置一条静态路由:
[R1]ip route-static 0.0.0.0 0 192.168.255.1
[R2]ip route-static 0.0.0.0 0 10.1.1.1
[R4]ip route-s 0.0.0.0 0.0.0.0 151.151.1.2
R3只能配置静态地址(没有限制跳数)
[R3]ip route-s 10.1.1.0 30 192.168.255.2
[R3]ip route-s 2.2.2.2 32 192.168.255.2
[R3]ip route-s 131.131.255.0 28 151.151.1.1
[R3]ip route-s 7.7.7.7 32 151.151.1.1
//注意,ip route-s 131.131.255.0 28实际上就是131.131.255.0 /30、131.131.255.4 /30、131.131.255.8 /30,这里做了汇总
R4需要发布OSPF默认路由
[R4]ospf 1
[R4-ospf-1]default-route-advertise
至此全网通,验证如下:
[R2]ping -a 2.2.2.2 7.7.7.7
PING 7.7.7.7: 56 data bytes, press CTRL_C to break
Reply from 7.7.7.7: bytes=56 Sequence=1 ttl=250 time=50 ms
Reply from 7.7.7.7: bytes=56 Sequence=2 ttl=250 time=70 ms
Reply from 7.7.7.7: bytes=56 Sequence=3 ttl=250 time=50 ms
Reply from 7.7.7.7: bytes=56 Sequence=4 ttl=250 time=40 ms
Reply from 7.7.7.7: bytes=56 Sequence=5 ttl=250 time=50 ms
--- 7.7.7.7 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/52/70 ms
[R2]tracert 7.7.7.7
traceroute to 7.7.7.7(7.7.7.7), max hops: 30 ,packet length: 40,press CTRL_C t
o break
1 10.1.1.1 20 ms 20 ms 10 ms
2 192.168.255.1 20 ms 20 ms 20 ms
3 151.151.1.1 30 ms 30 ms 30 ms
4 131.131.255.14 40 ms 40 ms 30 ms
5 131.131.255.9 40 ms 40 ms 40 ms
6 131.131.255.2 40 ms 50 ms 40 ms
补充:
在确认OSPF邻居是否建立时,在R6上查看命令更方便,因为该设备的邻居更多;
如果R4与R5之间或R5与R6之间线路出现问题,2.2.2.2仍可以ping通7.7.7.7(通过131.131.255.4 /30),线路恢复后,OSPF邻居重新建立后,2.2.2.2仍然通过R5到达7.7.7.7(Cost值更小,Serial接口cost值为48)
边栏推荐
猜你喜欢
【Cicadaplayer】Release无法断点调试的问题
2022r1 fast opening pressure vessel operation test and simulation test
【Pingtunnel工具教程】利用ICMP隧道技术进行ICMP封装穿透防火墙
顺序表与链表(顺序表)
【HMS core】【ML Kit】机器学习服务常见问题FAQ(二)
Client and server of grpc magiconion Library (case version)
Qiu Chengtong college students' Mathematical Competition Mathematical Physics
Shanghaofang - project summary
MFC obtains cfindreplacedialog control messages by registering window information
Parker hydraulic oil pump pvp3336r2m
随机推荐
借钱通过率高的产品有哪些?分享5款当天就可以放款的小贷
idm下载器是什么软件?最新V6.41版本号Win下载工具
堆(优先级队列)
Wechat applet development process
【多线程】并行和并发的区别
Qiu Chengtong college students' Mathematical Competition Mathematical Physics
[cicadaplayer] the problem that the release cannot debug at breakpoints
cordove 友盟插件 ++推送和统计功能
Spoole TCP server
Internet Download Manager old brand downloader best computer download tool
解决win10莫名其妙重启问题
classes. Jar: another program is using this file, and the process cannot access it.
Session layer and addressing mode of UDS diagnostic service
中年危机,关于未来的一些思考
Rexroth proportional valve 4wrpeh6c3b04l-3x/m/24f1-885
Parker hydraulic oil pump pv140r1k1t1nmm1
Functions and configuration of dcm09- readdatabyidentifier ($22) [based on DaVinci configurator classic]
【服务器数据恢复】华为某型号服务器raid6数据恢复案例
Prometheus prometheus+grafana, monitoring setup and basic interface configuration
【Cicadaplayer】Release无法断点调试的问题