R1:
router id 1.1.1.1
interface GigabitEthernet0/0/0
ip address 192.168.12.1 255.255.255.0
interface GigabitEthernet0/0/1
ip address 192.168.14.1 255.255.255.0
ospf 1
area 0.0.0.0
network 192.168.12.0 0.0.0.255
area 0.0.0.2
network 192.168.14.0 0.0.0.255
stub
R2:
router id 2.2.2.2
interface GigabitEthernet0/0/0
ip address 192.168.23.2 255.255.255.0
interface GigabitEthernet0/0/1
ip address 192.168.12.2 255.255.255.0
ospf 1
area 0.0.0.0
network 192.168.12.0 0.0.0.255
area 0.0.0.1
network 192.168.23.0 0.0.0.255
R3:
router id 3.3.3.3
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1
ip address 192.168.23.3 255.255.255.0
interface GigabitEthernet0/0/2
interface NULL0
interface LoopBack0
ip address 10.10.3.3 255.255.255.0
ospf 1
import-route static
area 0.0.0.1
network 10.10.3.0 0.0.0.255
network 192.168.23.0 0.0.0.255
ip route-static 192.168.1.0 255.255.255.0 192.168.23.2
R4:
router id 4.4.4.4
interface GigabitEthernet0/0/0
ip address 192.168.14.4 255.255.255.0
ospf 1
area 0.0.0.2
network 192.168.14.0 0.0.0.255
stub
验证:
查看ospf中Stub区域路由表
< R4>dis ospf routing
OSPF Process 1 with Router ID 4.4.4.4
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
192.168.14.0/24 1 Transit 192.168.14.4 4.4.4.4 0.0.0.2
0.0.0.0/0 2 Inter-area 192.168.14.1 1.1.1.1 0.0.0.2
10.10.3.3/32 3 Inter-area 192.168.14.1 1.1.1.1 0.0.0.2
192.168.12.0/24 2 Inter-area 192.168.14.1 1.1.1.1 0.0.0.2
192.168.23.0/24 3 Inter-area 192.168.14.1 1.1.1.1 0.0.0.2
Total Nets: 5
Intra Area: 1 Inter Area: 4 ASE: 0 NSSA: 0
无外部路由信息
查看ospf中Stub外部路由表
< R1>dis ospf routing
OSPF Process 1 with Router ID 1.1.1.1
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
192.168.12.0/24 1 Transit 192.168.12.1 1.1.1.1 0.0.0.0
192.168.14.0/24 1 Transit 192.168.14.1 1.1.1.1 0.0.0.2
10.10.3.3/32 2 Inter-area 192.168.12.2 2.2.2.2 0.0.0.0
192.168.23.0/24 2 Inter-area 192.168.12.2 2.2.2.2 0.0.0.0
Routing for ASEs
Destination Cost Type Tag NextHop AdvRouter
192.168.1.0/24 1 Type2 1 192.168.12.2 3.3.3.3
Total Nets: 5
Intra Area: 2 Inter Area: 2 ASE: 1 NSSA: 0
外部路由信息正常
注意:
1、R1(区域1的ABR)只通告一条默认路由,不通告AS-external-LSA;
2、区域间路由信息仍然被通告到Stub区域中。
来源:CSDN
作者:两个男孩
链接:https://blog.csdn.net/weixin_39041972/article/details/104439700