# 配置RouterD。
[RouterD-ospf-1] area 2
[RouterD-ospf-1-area-0.0.0.2] network 192.168.2.0 0.0.0.255 [RouterD-ospf-1-area-0.0.0.2] network 172.17.1.0 0.0.0.255 [RouterD-ospf-1-area-0.0.0.2] quit [RouterD-ospf-1] quit 、检验配置结果
# 查看RouterA的OSPF邻居。 [RouterA] display ospf peer
OSPF Process 1 with Router ID 192.168.1.1 Neighbors
Area 0.0.0.0 interface 192.168.0.1(Serial3/0)'s neighbors
Router ID: 192.168.2.1 Address: 192.168.0.2 State: Full Mode: Nbr is Master Priority: 1 DR: None BDR: None MTU: 0 Dead timer due in 32 sec Neighbor is up for 00:04:09 Authentication Sequence: [ 0 ] Neighbors
Area 0.0.0.1 interface 192.168.1.1(Serial4/0)'s neighbors
Router ID: 192.168.1.2 Address: 192.168.1.2 State: Full Mode: Nbr is Master Priority: 1 DR: None BDR: None MTU: 0 Dead timer due in 34 sec Neighbor is up for 00:04:21 Authentication Sequence: [ 0 ]
# 显示RouterA的OSPF路由信息。 [RouterA] display ospf routing
OSPF Process 1 with Router ID 192.168.1.1 Routing Tables Routing for Network
Destination Cost Type NextHop 172.16.1.0/24 1563 Stub 192.168.1.2 172.17.1.0/24 3125 Inter 192.168.0.2 192.168.0.0/24 1562 Stub 192.168.0.1 192.168.1.0/24 1562 Stub 192.168.1.1 192.168.2.0/24 3124 Inter 192.168.0.2 Total Nets: 5
Intra Area: 3 Inter Area: 2 ASE: 0 NSSA: 0 # 显示RouterA的LSDB。
第 6 页 共 8 页
GR State: Normal GR State: Normal AdvRouter Area 192.168.1.2 0.0.0.1 0.0.0.0 192.168.1.1 0.0.0.0 192.168.1.1 0.0.0.1 0.0.0.0 3 192.168.2.1 192.168.2.1 [RouterA] display ospf lsdb
OSPF Process 1 with Router ID 192.168.1.1 Link State Database Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric Router 192.168.1.1 192.168.1.1 478 48 80000007 0 Router 192.168.2.1 192.168.2.1 479 48 80000007 0 Sum-Net 192.168.1.0 192.168.1.1 489 28 80000001 1562 Sum-Net 172.17.1.0 192.168.2.1 492 28 80000001 1563 Sum-Net 192.168.2.0 192.168.2.1 492 28 80000001 1562 Sum-Net 172.16.1.0 192.168.1.1 467 28 80000001 1563 Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric Router 192.168.1.2 192.168.1.2 448 60 80000007 0 Router 192.168.1.1 192.168.1.1 472 48 80000004 0 Sum-Net 172.17.1.0 192.168.1.1 473 28 80000001 3125 Sum-Net 192.168.2.0 192.168.1.1 473 28 80000001 3124 Sum-Net 192.168.0.0 192.168.1.1 489 28 80000001 1562 # 查看RouterD的路由表,并使用Ping进行测试连通性。 [RouterD] display ospf routing
OSPF Process 1 with Router ID 192.168.2.2 Routing Tables Routing for Network
Destination Cost Type NextHop AdvRouter Area 172.16.1.0/24 4687 Inter 192.168.2.1 192.168.2.1 0.0.0.2 172.17.1.0/24 1 Stub 172.17.1.1 192.168.2.2 0.0.0.2 192.168.0.0/24 3124 Inter 192.168.2.1 192.168.2.1 0.0.0.2 192.168.1.0/24 4686 Inter 192.168.2.1 192.168.2.1 0.0.0.2 192.168.2.0/24 1562 Stub 192.168.2.2 192.168.2.2 0.0.0.2 Total Nets: 5
Intra Area: 2 Inter Area: 3 ASE: 0 NSSA: 0 [RouterD] ping 172.16.1.1
PING 172.16.1.1: 56 data bytes, press CTRL_C to break
Reply from 172.16.1.1: bytes=56 Sequence=1 ttl=253 time=62 ms Reply from 172.16.1.1: bytes=56 Sequence=2 ttl=253 time=16 ms Reply from 172.16.1.1: bytes=56 Sequence=3 ttl=253 time=62 ms Reply from 172.16.1.1: bytes=56 Sequence=4 ttl=253 time=94 ms Reply from 172.16.1.1: bytes=56 Sequence=5 ttl=253 time=63 ms --- 172.16.1.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss
第 7 页 共 8 页
round-trip min/avg/max = 16/59/94 ms
第 8 页 共 8 页