当前位置:文档之家› OSPF多区域

OSPF多区域

多区域 OSPFOSPF MultiArea【实验目的】了解和掌握ospf的原理,熟悉ospf多域配置步骤。

懂得如何配置Vitrul links,Transit area, Stub Area ,Totally Stubby Area, Not-so-stubby area(nssa)。

【实验原理】了解Internal router,Backbone router,Area Border Router (ABR), Autonomous System Boundary Router (ASBR) 以及各种类型链路通告的不同之处,优化ospf网络。

【实验拓扑】【实验设备】路由器五台,串行线,用于配置路由的主机【实验内容】1、按图示配置端口,用ping检查各端口间连通性(A/B,E/F用于virtul links实验; C的lo地址在用于验证external routesummarization D的lo地址加入area 8,为验证interarea summarization; A/F的lo 地址在nssa时才加入)建议配置好各个neighber的vty,可以用一台终端观察整个拓扑。

(config)#enable password cisco(config)#line vty 0 4(config-line)#Login(config-line)#Password cisco利用terminal monitor可在telnet上看到debug输出2、在各个路由器启动ospf进程,注意area的分布Router(config)#router ospf *Router(config-router)#network *.*.*.* *.*.*.* area *查看ABR/ASBR/DR/BDR。

show ip ospfshow ip ospf interfaceshow ip ospf neighborshow ip ospf neighbor detail3、 show ip route查看各router路由表,注意area 10,area 11没出现在别的router。

(loopback地址当主机路由发布)4、配置Vitrul links,使area 10,area 11可以正常工作。

观察路由表项:(原来没有连接到backbone area的area的具体情况: 可观察到:area运行和工作状态正常,但是就是没有收到其他area的链路状态通告)C#show ip route配置在ABR上进行(B/C),(D/E):(config-router)#area 5 virtual-link (router-id)(router id可通过show ip ospf neighbor查看,互指对端)观察配置前后不同之处:A/F#show ip route (show neighbor与debug的话输出和以前一样很正常) C/E#show ip route B/C,E/F#show ip ospf virtual-links此时area 5,area 1为transit area。

5、在D配置interarea route summarization,观察配置结果观察未配置时的路由表:Router#show ip route配置summarization:D(config-router)#area 8 range 192.168.64.0 255.255.252.0观察配置结果:D#show ip route C 192.168.64.0/24 is directly connected, Loopback0 C192.168.65.0/24 is directly connected, Loopback1 C 192.168.66.0/24 is directly connected, Loopback4C 192.168.67.0/24 is directly connected, Loopback8 O 192.168.64.0/22 is asummary, 00:00:02, Null0E#show ip route O IA 192.168.64.0/22 [110/129] via 192.168.1.9, 00:00:45, Serial1原为4项主机路由,变为一项。

或者是用命令:Router#show ip route supernets-only6、在C添加外部路由,配置重分布并观察配置:C(config)#ip route 172.16.0.0 255.255.0.0 null 0Router(config-router)#redistribute static subnets metric-type ? 1 Set OSPF External Type 1 metrics 2 Set OSPF External Type 2 metricsC(config-router)#redistribute static subsnets (E2,static metrics)(不加上subnets只重发布classful路由:% Only classful networks will beredistributed)观察配置结果:Router# show ip route更改配置:C(config-router)#redistribute static subnets metric-type 1 (E1)在各个router比较输出的不同(metric值)router>show ip route7、验证external route summarization配置:C(config)#ip route 172.17.0.0 255.255.0.0 null 0C(config)#ip route 172.18.0.0 255.255.0.0 null 0C(config)#ip route 172.19.0.0 255.255.0.0 null 0C(config-router)#summary-address 172.16.0.0 255.252.0.0观察配置结果:C#show ip route S 172.17.0.0/16 is directly connected, Null0 S 172.16.0.0/16 is directly connected, Null0 S 172.19.0.0/16 is directly connected, Null0 S 172.18.0.0/16 is directly connected, Null0 O 172.16.0.0/14 is a summary, 00:00:02, Null0 或者可以使用命令:Router#show ip route supernets-only8、传播默认路由C配置一个loopback端口,用于验证默认路由起作用。

C(config)#interface lo 0C(config-if)#ip address 172.16.0.1 255.255.255.0配置:C(config-router)#default-information originate alwaysalways使C强行通告默认路由,即使C本身没有默认路由。

观察配置结果:Show发现本机路由表不发生变化,但对别的router起作用C#show ip route Gateway of last resort is not set router>show ip route Gateway of last resort is 192.168.1.* to network 0.0.0.0ping C loopback端口(172.16.0.1),验证默认路由起作用去掉C loopback端口,再ping假设C的loopback端口为internet地址,重新加入。

A/F的loopback端口暂未要配置。

去掉第8中配置的默认路由发布。

loopback地址参考拓扑图。

9、配置Stub Area ,Totally Stubby Arearouter路由表原只有IA项,C做了静态重分布后多了E*项。

亦即有type-5的LSA到达C(config)#interface lo 0C(config-if)#ip address 172.16.0.1 255.255.255.0C(config)#interface lo 1C(config-if)#ip address 172.16.1.1 255.255.255.0C(config)#interface lo 2C(config-if)#ip address 172.16.2.1 255.255.255.0C(config)#interface lo 3C(config-if)#ip address 172.16.3.1 255.255.255.0C(config-router)#redistribute conneted subnets(无subnets时,% Only classful networks will be redistributed)观察重分布结果:router#show ip route分别在A/B和E/F配置Stub Area:A(config-router)#area 10 stubB(config-router)#area 10 stubE(config-router)#area 11 stubF(config-router)#area 11 stub如果配置时间差较大,可观察到邻接关系断开router#show ip ospf (观察area变化)…………It is a stub area…………router#show ip route (观察路由表)没了E2项,多了默认路由(不接受Type 5 LSAs)配置Totally Stubby Area:B(config-router)#no area 10 stubB(config-router)#area 10 stub no-summaryE(config-router)#no area 11 stubE(config-router)#area 11 stub no-summary如果同时配置stub和stub no-summary,no-summary起作用router#show ip route (观察default路由)只剩下C项和O*IA项(不接受Type 3/4 LSAs,只需在ABR上配置)10、配置Not-so-stubby area(nssa)配置A和F的loopback端口,模拟非ospf域,使A和E成为ASBR;清除第9步中router ospf stub area的配置。

相关主题