组网需求
如图所示,所有的Switch都运行OSPF,整个自治系统划分为3个区域。其中SwitchA和SwitchB作为ABR来转发区域之间的路由,SwitchD作为ASBR引入了外部路由(静态路由)。要求将Area1配置为NSSA区域,同时将SwitchC配置为ASBR引入外部路由(静态路由),且路由信息可正确的在AS内传播。
图 配置OSPF NSSA 区域组网图
设备 接口 对应的VLANIF IP地址
SwitchA Ethernet 0/0/1 VLANIF 10 192.168.0.1/24
SwitchA Ethernet 0/0/2 VLANIF 20 192.168.1.1/24
SwitchB Ethernet 0/0/1 VLANIF 10 192.168.0.2/24
SwitchB Ethernet 0/0/2 VLANIF 30 192.168.2.1/24
SwitchC Ethernet 0/0/1 VLANIF 20 192.168.1.2/24
SwitchC Ethernet 0/0/2 VLANIF 40 172.16.1.1/24
SwitchD Ethernet 0/0/1 VLANIF 30 192.168.2.2/24
SwitchD Ethernet 0/0/2 VLANIF 50 172.17.1.1/24
SwitchE Ethernet 0/0/1 VLANIF 40 172.16.1.2/24
SwitchF Ethernet 0/0/1 VLANIF 50 172.17.1.2/24
配置思路
采用如下的思路配置OSPF的NSSA区域:
1. 在各Switch上使能OSPF,配置OSPF基本功能。
2. 在SwitchD上配置静态路由,并在OSPF中引入。
3. 配置Area1为NSSA区域(需要在Area1内所有的设备上配置nssa命令),查看SwitchC的OSPF路由信息。
4. 在SwitchC上配置静态路由,并在OSPF中引入,查看SwitchD的OSPF路由信息。
配置步骤
1. 配置OSPF基本功能(请参见举例http://www.elvhome.com/html/2013-5-14/20135141414555462.html)
2. 配置SwitchD引入静态路由(请参见举例http://www.elvhome.com/html/2013-5-14/201351414273537731.html)
3. 配置Area1区域为NSSA区域
# 配置SwitchA。
[SwitchA-ospf-1] area 1
[SwitchA-ospf-1-area-0.0.0.1] nssa default-route-advertise no-summary
[SwitchA-ospf-1-area-0.0.0.1] quit
[SwitchA-ospf-1] quit
# 配置SwitchC。
[SwitchC] ospf
[SwitchC-ospf-1] area 1
[SwitchC-ospf-1-area-0.0.0.1] nssa
[SwitchC-ospf-1-area-0.0.0.1] quit
[SwitchC-ospf-1] quit
# 配置SwitchE。
[SwitchE] ospf
[SwitchE-ospf-1] area 1
[SwitchE-ospf-1-area-0.0.0.1] nssa
[SwitchE-ospf-1-area-0.0.0.1] quit
[SwitchE-ospf-1] quit
说明
建议在ABR(这里的SwitchA)上配置default-route-advertise no-summary参数,这样可以减少NSSA区域设备的路由表容量。其他位于NSSA区域的设备只需配置nssa命令就可以。
# 查看SwitchC的OSPF路由表。
[SwitchC] display ospf routing
OSPF Process 1 with Router ID 3.3.3.3
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
0.0.0.0/0 2 Inter-area 192.168.1.1 1.1.1.1 0.0.0.1
172.16.1.0/24 1 Transit 172.16.1.1 3.3.3.3 0.0.0.1
192.168.1.0/24 1 Transit 192.168.1.2 3.3.3.3 0.0.0.1
Total Nets: 3
Intra Area: 2 Inter Area: 1 ASE: 0 NSSA: 0
4. 配置SwitchC引入静态路由
# 在SwitchC引入静态路由,例如。
[SwitchC] ip route-static 100.0.0.0 8 null 0
[SwitchC] ospf
[SwitchC-ospf-1] import-route static
[SwitchC-ospf-1] quit
5. 验证配置结果
# 查看SwitchD的OSPF路由表。
[SwitchD] display ospf routing
OSPF Process 1 with Router ID 4.4.4.4
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
172.16.1.0/24 4 Inter-area 192.168.2.1 2.2.2.2 0.0.0.2
172.17.1.0/24 1 Transit 172.17.1.1 4.4.4.4 0.0.0.2
192.168.0.0/24 2 Inter-area 192.168.2.1 2.2.2.2 0.0.0.2
192.168.1.0/24 3 Inter-area 192.168.2.1 2.2.2.2 0.0.0.2
192.168.2.0/24 1 Transit 192.168.2.2 4.4.4.4 0.0.0.2
Routing for ASEs
Destination Cost Type Tag NextHop AdvRouter
100.0.0.0/8 1 Type2 1 192.168.2.1 1.1.1.1
Total Nets: 6
Intra Area: 2 Inter Area: 3 ASE: 1 NSSA: 0
在SwitchD上可以看到NSSA区域引入的一条AS外部的路由。
配置文件下载:
http://pan.baidu.com/share/link?shareid=401179&uk=2332071257
不能下载联系我:QQ 378254296 , 留下你的邮箱 我会发给你。





