R2与R3起OSPF进程,区域0。R1模拟公网路由器
R2与R3分别向R1指缺省路由,引入OSPF进程。
互联地址:
R1-R2为11.1.12.0网段,最后一位为路由编号。如R1为11.1.12.1
R2-R3为11.1.23.0网段,R1-R3为11.1.13.0网段。
配置1:
R2与R3分别向R1指缺省路由,引入OSPF进程。查看ospf LSDB表,ospf router表,及ip表
R2 配置
[R2]dis th
ip route-static 0.0.0.0 0 11.1.12.1
ospf 1
default-route-advertise
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 11.1.12.0 0.0.0.255
network 11.1.23.0 0.0.0.255
#
R3配置
[R3]dis th
ospf 1
default-route-advertise
area 0.0.0.0
network 3.3.3.0 0.0.0.255
network 11.1.13.0 0.0.0.255
network 11.1.23.0 0.0.0.255
#
ip route-static 0.0.0.0 0 11.1.13.1
此时查看各自路由表,ospf路由表,ospf lsdb 发现只有自己的静态缺省
R2:
[R2]dis ip routing-table
Destinations : 20 Routes : 20
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 Static 60 0 11.1.12.1 GE0/0
[R2]dis ospf lsdb
OSPF Process 1 with Router ID 2.2.2.2
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 3.3.3.3 3.3.3.3 918 60 80000007 0
Router 2.2.2.2 2.2.2.2 917 60 80000007 0
Network 11.1.23.3 3.3.3.3 918 32 80000001 0
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 0.0.0.0 2.2.2.2 25 36 80000001 1
External 0.0.0.0 3.3.3.3 958 36 80000001 1
[R2]dis ospf routing
OSPF Process 1 with Router ID 2.2.2.2
Routing Table
Routing for network
Destination Cost Type NextHop AdvRouter Area
11.1.12.0/24 1 Stub 0.0.0.0 2.2.2.2 0.0.0.0
11.1.13.0/24 2 Stub 11.1.23.3 3.3.3.3 0.0.0.0
11.1.23.0/24 1 Transit 0.0.0.0 3.3.3.3 0.0.0.0
3.3.3.3/32 1 Stub 11.1.23.3 3.3.3.3 0.0.0.0
2.2.2.2/32 0 Stub 0.0.0.0 2.2.2.2 0.0.0.0
Total nets: 5
Intra area: 5 Inter area: 0 ASE: 0 NSSA: 0
R3:
Destinations : 20 Routes : 20
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/0 Static 60 0 11.1.13.1 GE0/2
[R3]dis ospf routing
OSPF Process 1 with Router ID 3.3.3.3
Routing Table
Routing for network
Destination Cost Type NextHop AdvRouter Area
11.1.12.0/24 2 Stub 11.1.23.2 2.2.2.2 0.0.0.0
11.1.13.0/24 1 Stub 0.0.0.0 3.3.3.3 0.0.0.0
11.1.23.0/24 1 Transit 0.0.0.0 3.3.3.3 0.0.0.0
3.3.3.3/32 0 Stub 0.0.0.0 3.3.3.3 0.0.0.0
2.2.2.2/32 1 Stub 11.1.23.2 2.2.2.2 0.0.0.0
Total nets: 5
Intra area: 5 Inter area: 0 ASE: 0 NSSA: 0
[R3]dis ospf lsdb
OSPF Process 1 with Router ID 3.3.3.3
Link State Database
Area: 0.0.0.0
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 3.3.3.3 3.3.3.3 1052 60 80000007 0
Router 2.2.2.2 2.2.2.2 1053 60 80000007 0
Network 11.1.23.3 3.3.3.3 1052 32 80000001 0
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 0.0.0.0 3.3.3.3 1092 36 80000001 1
External 0.0.0.0 2.2.2.2 110 36 80000001 1
[R3]
当一台OSPF路由器发布缺省时,如果本身有缺省路由。则对收到的五类缺省LSA不进行计算。
OSPF在发布缺省时有一个参数,permit-calculate-other,指定此参数,则不论本身是否产生LSA,都会计算收到的缺省路由。
有一种情况例外,如果OSPF先学习到对端发布的缺省,本设备再配置低于对端发布缺省路由优先级的缺省路由将不会覆盖已生成的对端OSPF路由表。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作