OSPF单域配置
拓扑:
案例需求
- 如图,配置设备IP地址
- 配置OSPF协议,所有网段属于区域0
- 验证各路由器的邻接表
- 验证各路由器的路由表能学习到OSPF路由
- 验证在R1的路由表中,路由条目192.168.2.0/24的开销
- 确保在R3的路由表中,路由条目192.168.1.0/24的开销为11
- 确保PC-1和PC-2可以互通
配置:
R1的配置:
ospf 1 router-id 1.1.1.1
area 0
network 192.168.1.0 0.0.0.255
network 192.168.12.0 0.0.0.255
quit
R2的配置:
ospf 1 router-id 2.2.2.2
area 0
network 192.168.12.0 0.0.0.255
network 192.168.23.0 0.0.0.255
quit
R3的配置:
ospf 1 router-id 3.3.3.3
area 0
network 192.168.23.0 0.0.0.255
network 192.168.2.0 0.0.0.255
quit
查看数据库
<AR2>dis ospf lsdb
OSPF Process 1 with Router ID 192.168.34.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 192.168.34.2 192.168.34.2 277 48 8000001A 1
Router 1.1.1.1 1.1.1.1 282 48 80000017 1
Router 192.168.45.2 192.168.45.2 280 48 80000017 1
Network 192.168.23.2 192.168.34.2 281 32 8000000E 0
Network 192.168.34.1 192.1