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 no-summary
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 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
验证:
查看完全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
Total Nets: 2
Intra Area: 1 Inter Area: 1 ASE: 0 NSSA: 0
只有区域内路由信息和一条默认路由
查看完全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、完全Stub区域只通告一条默认路由;
2、不通告任何区域间的路由信息;
3、不通告任何AS-external-LSA