R1 的配置

 

interface f0/0

ip add 20.0.0.1 255.255.255.252

no shutdown

 

interface f1/0

ip add 10.10.0.1 255.255.255.252

no shutdown

 

interface f2/0

ip add 10.0.0.1 255.255.255.252

no shutdown

 

interface loopback 0

ip add 1.1.1.1 255.255.255.0

 

router ospf 11

network 20.0.0.0 0.0.0.3 area 2

network 10.0.0.0 0.0.0.3 area 0

network 10.10.0.0 0.0.0.3 area 0

area 2 stub

 

R2 的配置

 

interface f0/0

ip add 30.0.0.1 255.255.255.252

no shutdown

 

interface f1/0

ip add 10.10.10.1 255.255.255.252

no shutdown

 

interface f2/0

ip add 10.0.0.2 255.255.255.252

no shutdown

 

interface loopback 0

ip add 2.2.2.2 255.255.255.0

 

router ospf 12

network 30.0.0.0 0.0.0.3 area 3

network 10.10.10.0 0.0.0.3 area 0

network 10.0.0.0 0.0.0.3 area 0

area 3 stub no-summary

 

R3 的配置

 

interface f0/0

ip add 40.0.0.1 255.255.255.252

no shutdown

 

 

interface f1/0

ip add 10.10.0.2 255.255.255.252

no shutdown

 

interface f2/0

ip add 10.10.10.2 255.255.255.252

no shutdown

 

interface loopback 0

ip add 3.3.3.3 255.255.255.0

 

router ospf 13

network 40.0.0.0 0.0.0.3 area 4

network 10.10.0.0 0.0.0.3 area 0

network 10.10.10.0 0.0.0.3 area 0

area 4 nssa no-summary

 

R4 的配置

 

interface f0/0

ip add 20.0.0.2 255.255.255.252

no shutdown

 

interface loopback 0

ip add 4.4.4.4 255.255.255.0

 

router ospf 14

network 20.0.0.0 0.0.0.3 area 2

area 2 stub

R5 的配置

 

interface f0/0

ip add 30.0.0.2 255.255.255.252

no shutdown

 

 

interface loopback 0

ip add 5.5.5.5 255.255.255.252

 

router ospf 15

network 30.0.0.0 0.0.0.3 area 3

area 3 stub no-summary

 

 

R6 的配置 (ASBR)

 

interface f0/0

ip add 40.0.0.2 255.255.255.252

no shutdown

 

interface f1/0

ip add 172.16.0.1 255.255.0.0

no shutdown

 

interface loopback 0

ip add 6.6.6.6 255.255.255.0

 

router ospf 16

network 40.0.0.0 0.0.0.3 area 4

area 4 nssa no-summary

redistribute rip subnets

 

router rip

version 2

no auto  关闭路由汇总

network 172.16.0.0

redistribute ospf 16 metric 10

 

R7 的配置

interface f0/0

ip add 172.16.0.1 255.255.0.0

no shutdown

 

router rip

version 2

network 172.16.0
nssa非纯末梢区域

  在一个自治区的末梢区域   连接了一个路由器或是一个不同协议的自治区    它们之间要通信就必须通过该路由器与末梢区域的边界路由器相连    组成一个 nssa  而边界路由器则变成了一个 ASBR

 

配置 nssa 区域

router ospf 10

area 1 nssa no-summary

nssa 区域的所有边界路由器 ASBR 都需要配置 no-summary

 

no-summary 是可选参数   ABR 上配置 NSSA 区域时如果使用 no-summary 这条命令。除了允许通告一条指向 ABR 的默认路由的类型 3 lsa 外,其他的类型 3 和类型 4 lsa 都在 nssa 区域内被阻止。