1.拓扑图
2.在各路由器上配置ospf
R1:
R2:
R3:
3.查看邻居表、拓扑表、路由表
R1:
r1#show ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
12.1.1.2 1 FULL/BDR 00:00:36 12.1.1.2 FastEthernet0/0
12.1.1.2 1 FULL/BDR 00:00:31 123.1.1.2 FastEthernet0/1
33.3.3.3 1 FULL/DROTHER 00:00:31 123.1.1.3 FastEthernet0/1
r1#show ip ospf data
OSPF Router with ID (123.1.1.1) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
123.1.1.1 123.1.1.1 1108 0x80000009 0x00fcff 2
12.1.1.2 12.1.1.2 1109 0x80000009 0x00fcff 2
33.3.3.3 33.3.3.3 950 0x8000000a 0x00fcff 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
12.1.1.1 123.1.1.1 1119 0x8000000c 0x0094cc
123.1.1.1 123.1.1.1 959 0x8000000d 0x003198
r1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 123.1.1.3, 02:46:18, FastEthernet0/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0
123.0.0.0/24 is subnetted, 1 subnets
C 123.1.1.0 is directly connected, FastEthernet0/1
r1#
R2:
r2#show ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
123.1.1.1 1 FULL/DR 00:00:31 12.1.1.1 FastEthernet0/0
123.1.1.1 1 FULL/DR 00:00:36 123.1.1.1 FastEthernet0/1
33.3.3.3 1 FULL/DROTHER 00:00:35 123.1.1.3 FastEthernet0/1
r2#show ip ospf data
OSPF Router with ID (12.1.1.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
12.1.1.2 12.1.1.2 1280 0x80000009 0x00fcff 2
123.1.1.1 123.1.1.1 1280 0x80000009 0x00fcff 2
33.3.3.3 33.3.3.3 1122 0x8000000a 0x00fcff 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
12.1.1.1 123.1.1.1 1291 0x8000000c 0x0094cc
123.1.1.1 123.1.1.1 1131 0x8000000d 0x003198
r2#sho ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 123.1.1.3, 02:49:14, FastEthernet0/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, FastEthernet0/0
123.0.0.0/24 is subnetted, 1 subnets
C 123.1.1.0 is directly connected, FastEthernet0/1
r2#
R3:
r3#
r3#show ip ospf nei
Neighbor ID Pri State Dead Time Address Interface
12.1.1.2 1 FULL/BDR 00:00:39 123.1.1.2 FastEthernet0/0
123.1.1.1 1 FULL/DR 00:00:30 123.1.1.1 FastEthernet0/0
r3#show ip ospf data
OSPF Router with ID (33.3.3.3) (Process ID 100)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
33.3.3.3 33.3.3.3 1179 0x8000000a 0x00fcff 2
12.1.1.2 12.1.1.2 1339 0x80000009 0x00fcff 2
123.1.1.1 123.1.1.1 1338 0x80000009 0x00fcff 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
12.1.1.1 123.1.1.1 1349 0x8000000c 0x0094cc
123.1.1.1 123.1.1.1 1189 0x8000000d 0x003198
r3#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
12.0.0.0/24 is subnetted, 1 subnets
O 12.1.1.0 [110/2] via 123.1.1.2, 02:50:15, FastEthernet0/0
[110/2] via 123.1.1.1, 02:50:15, FastEthernet0/0
33.0.0.0/24 is subnetted, 1 subnets
C 33.3.3.0 is directly connected, Loopback1
123.0.0.0/24 is subnetted, 1 subnets
C 123.1.1.0 is directly connected, FastEthernet0/0
r3#
r3#
本文转自kindIT 51CTO博客,原文链接:http://blog.51cto.com/kindit/1020350,如需转载请自行联系原作者