图 OSPF单域配置实验拓扑图
OSPF缺省路由发布及验证
在R1上配置缺省路由并发布到OSPF域内。
配置R1
interface LoopBack1
ip address 10.10.10.10 255.255.255.0
[R1]ip route-static 0.0.0.0 0.0.0.0 LoopBack 1
[R1]ospf 1
[R1-ospf-1]default-route-advertise
查看R2和R3的路由表。可以看到,R2和R3均已经学习到了R1发布的缺省路由。
[R2]display ip routing-table
Route Flags: R - relay, D - download to fib
Routing Tables: Public
Destinations : 20 Routes : 21
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_ASE 150 1 D 10.1.12.1 GigabitEthernet0/0/1
[R3]display ip routing-table
Route Flags: R - relay, D - download to fib
Routing Tables: Public
Destinations : 20 Routes : 21
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_ASE 150 1 D 10.1.13.1 GigabitEthernet0/0/1
使用ping命令,检测R2和R3与10.10.10.10/24网段之间的连通性,验证默认路由的有效性。
[R2]ping 10.10.10.10
PING 10.10.10.10: 56 data bytes, press CTRL_C to break
Reply from 10.10.10.10: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 10.10.10.10: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.10.10.10: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 10.10.10.10: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.10.10.10: bytes=56 Sequence=5 ttl=255 time=30 ms
[R3]ping 10.10.10.10
PING 10.10.10.10: 56 data bytes, press CTRL_C to break
Reply from 10.10.10.10: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 10.10.10.10: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.10.10.10: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 10.10.10.10: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.10.10.10: bytes=56 Sequence=5 ttl=255 time=40 ms
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。