1.OSPF单区域配置
![图片[1]-3.4 OSPF配置详解-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片1-12.png)
1)基本配置
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]are
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
2)查看邻居表
[R1]display ospf peer
OSPF Process 1 with Router ID 1.1.1.1
Neighbors
Area 0.0.0.0 interface 12.1.1.1(GigabitEthernet0/0/0)'s neighbors
Router ID: 2.2.2.2 Address: 12.1.1.2
State: Full Mode:Nbr is Master Priority: 1
DR: 12.1.1.2 BDR: 12.1.1.1 MTU: 0
Dead timer due in 40 sec
Retrans timer interval: 5
Neighbor is up for 00:02:48
Authentication Sequence: [ 0 ]
3)查看OSPF路由表
[R1]display ospf routing
OSPF Process 1 with Router ID 1.1.1.1
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
1.1.1.1/32 0 Stub 1.1.1.1 1.1.1.1 0.0.0.0
12.0.0.0/8 1 Transit 12.1.1.1 1.1.1.1 0.0.0.0
192.168.1.0/24 1 Stub 192.168.1.254 1.1.1.1 0.0.0.0
192.168.2.0/24 1 Stub 192.168.2.254 1.1.1.1 0.0.0.0
2.2.2.2/32 1 Stub 12.1.1.2 2.2.2.2 0.0.0.0
4)查看R1的OSPF路由表
[R1]display ip routing-table protocol ospf
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 OSPF 10 1 D 12.1.1.2 GigabitEthernet0/0/0
5)查看R1的Type-1LSA
[R1]display ospf lsdb router 1.1.1.1
OSPF Process 1 with Router ID 1.1.1.1
Area: 0.0.0.0
Link State Database
Type : Router
Ls id : 1.1.1.1
Adv rtr : 1.1.1.1
Ls age : 641
Len : 72
Options : E
seq# : 80000008
chksum : 0x9088
Link count: 4
* Link ID: 1.1.1.1
Data : 255.255.255.255
Link Type: StubNet
Metric : 0
Priority : Medium
* Link ID: 12.1.1.2
Data : 12.1.1.1
Link Type: TransNet
Metric : 1
* Link ID: 192.168.1.0
Data : 255.255.255.0
Link Type: StubNet
Metric : 1
Priority : Low
* Link ID: 192.168.2.0
Data : 255.255.255.0
Link Type: StubNet
Metric : 1
Priority : Low
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容