拓扑图

图2.2 OSPF单域配置实验拓扑图

验证OSPF配置

待OSPF收敛完成后,查看R1、R2和R3上的路由表。

[R1]display ip routing-table

Route Flags: R - relay, D - download to fib


Routing Tables: Public

Destinations : 19 Routes : 20

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.1.0.1/32 Direct 0 0 D 127.0.0.1 LoopBack0

10.1.0.2/32 OSPF 10 1 D 10.1.12.2 GigabitEthernet0/0/1

10.1.0.3/32 OSPF 10 1 D 10.1.13.3 GigabitEthernet0/0/2

10.1.23.0/24 OSPF 10 2 D 10.1.12.2 GigabitEthernet0/0/1

OSPF 10 2 D 10.1.13.3 GigabitEthernet0/0/2

172.16.1.0/24 OSPF 10 2 D 10.1.12.2 GigabitEthernet0/0/1

192.168.1.0/24 OSPF 10 2 D 10.1.13.3 GigabitEthernet0/0/2

[R2]display ip routing-table

Route Flags: R - relay, D - download to fib


Routing Tables: Public

Destinations : 19 Routes : 20

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.1.0.1/32 OSPF 10 1 D 10.1.12.1 GigabitEthernet0/0/1

10.1.0.3/32 OSPF 10 1 D 10.1.23.3 GigabitEthernet0/0/2

10.1.1.0/24 OSPF 10 2 D 10.1.12.1 GigabitEthernet0/0/1

10.1.13.0/24 OSPF 10 2 D 10.1.12.1 GigabitEthernet0/0/1

OSPF 10 2 D 10.1.23.3 GigabitEthernet0/0/2

192.168.1.0/24 OSPF 10 2 D 10.1.23.3 GigabitEthernet0/0/2

<R3>display ip routing-table

[R3]display ip routing-table

Route Flags: R - relay, D - download to fib


Routing Tables: Public

Destinations : 19 Routes : 20

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.1.0.1/32 OSPF 10 1 D 10.1.13.1 GigabitEthernet0/0/1

10.1.0.2/32 OSPF 10 1 D 10.1.23.2 GigabitEthernet0/0/2

10.1.1.0/24 OSPF 10 2 D 10.1.13.1 GigabitEthernet0/0/1

10.1.12.0/24 OSPF 10 2 D 10.1.13.1 GigabitEthernet0/0/1

OSPF 10 2 D 10.1.23.2 GigabitEthernet0/0/2

172.16.1.0/24 OSPF 10 2 D 10.1.23.2 GigabitEthernet0/0/2

检测PC1、PC2和PC3之间的连通性。

在PC1 ping PC2测试

PC1>ping 172.16.1.2

Ping 172.16.1.2: 32 data bytes, Press Ctrl_C to break

From 172.16.1.2: bytes=32 seq=1 ttl=126 time=31 ms

From 172.16.1.2: bytes=32 seq=2 ttl=126 time=15 ms

From 172.16.1.2: bytes=32 seq=3 ttl=126 time=15 ms

From 172.16.1.2: bytes=32 seq=4 ttl=126 time=16 ms

From 172.16.1.2: bytes=32 seq=5 ttl=126 time=31 ms

在PC1 ping PC3测试

PC1>ping 192.168.1.3

Ping 192.168.1.3: 32 data bytes, Press Ctrl_C to break

From 192.168.1.3: bytes=32 seq=1 ttl=126 time=31 ms

From 192.168.1.3: bytes=32 seq=2 ttl=126 time=16 ms

From 192.168.1.3: bytes=32 seq=3 ttl=126 time=16 ms

From 192.168.1.3: bytes=32 seq=4 ttl=126 time=31 ms

From 192.168.1.3: bytes=32 seq=5 ttl=126 time=15 ms

在PC2 ping PC3测试

PC2>ping 192.168.1.3

Ping 192.168.1.3: 32 data bytes, Press Ctrl_C to break

From 192.168.1.3: bytes=32 seq=1 ttl=126 time=15 ms

From 192.168.1.3: bytes=32 seq=2 ttl=126 time=15 ms

From 192.168.1.3: bytes=32 seq=3 ttl=126 time=15 ms

From 192.168.1.3: bytes=32 seq=4 ttl=126 time=15 ms

From 192.168.1.3: bytes=32 seq=5 ttl=126 time=15 ms

执行display ospf peer命令,查看OSPF邻居详细状态。

[R1]disp ospf peer

OSPF Process 1 with Router ID 10.1.0.1

Neighbors

Area 0.0.0.0 interface 10.1.12.1(GigabitEthernet0/0/1)'s neighbors

Router ID: 10.1.0.2 Address: 10.1.12.2

State: Full Mode:Nbr is Master Priority: 1

DR: 10.1.12.1 BDR: 10.1.12.2 MTU: 0

Dead timer due in 38 sec

Retrans timer interval: 5

Neighbor is up for 00:26:16

Authentication Sequence: [ 0 ]

Neighbors

Area 0.0.0.0 interface 10.1.13.1(GigabitEthernet0/0/2)'s neighbors

Router ID: 10.1.0.3 Address: 10.1.13.3

State: Full Mode:Nbr is Master Priority: 1

DR: 10.1.13.1 BDR: 10.1.13.3 MTU: 0

Dead timer due in 36 sec

Retrans timer interval: 5

Neighbor is up for 00:21:21

Authentication Sequence: [ 0 ]

display ospf peer命令显示所有OSPF邻居的详细信息。本任务中,在10.1.12.0网段上R1是DR。由于DR选举是非抢占模式,如果OSPF进程不重启,R2将不会取代R1的DR角色。

执行display ospf peer brief命令,可以查看简要的OSPF邻居信息。

[R1]disp ospf peer brief

OSPF Process 1 with Router ID 10.1.0.1

Peer Statistic Information


Area Id Interface Neighbor id State

0.0.0.0 GigabitEthernet0/0/1 10.1.0.2 Full

0.0.0.0 GigabitEthernet0/0/2 10.1.0.3 Full


[R2]display ospf peer brief

OSPF Process 1 with Router ID 10.1.0.2

Peer Statistic Information


Area Id Interface Neighbor id State

0.0.0.0 GigabitEthernet0/0/1 10.1.0.1 Full

0.0.0.0 GigabitEthernet0/0/2 10.1.0.3 Full


[R3]display ospf peer brief

OSPF Process 1 with Router ID 10.1.0.3

Peer Statistic Information


Area Id Interface Neighbor id State

0.0.0.0 GigabitEthernet0/0/1 10.1.0.1 Full

0.0.0.0 GigabitEthernet0/0/2 10.1.0.2 Full



微思郭仔
31 声望2 粉丝

微思IT认证培训-思科、华为、红帽、oracle、VMware、PMP、CISP等,一切为了成为更好的自己,加油!!!