配置在ABR上进行(B/C): B/C(config-router)#area 5 virtual-link (router-id) (router id可通过show ip ospf neighbor查看,互指对端)
观察配置前后不同之处: A#show ip route (show neighbor与debug的话输出和以前一样很正常) C#show ip route B/C#show ip ospf virtual-links 此时area 5为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 C 192.168.65.0/24 is directly connected, Loopback1 C 192.168.66.0/24 is directly connected, Loopback4 C 192.168.67.0/24 is directly connected, Loopback8 O 192.168.64.0/22 is a summary, 00:00:02, Null0
E#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-only
Router(config-router)#redistribute static subnets metric-type ? 1 Set OSPF External Type 1 metrics 2 Set OSPF External Type 2 metrics C(config-router)#redistribute static subsnets (E2,static metrics) (不加上subnets只重发布classful路由: % Only classful networks will be redistributed) 观察配置结果: Router# show ip route 更改配置: C(config-router)#redistribute static subnets metric-type 1 (E1) 在各个router比较输出的不同(metric值) router>show ip route 7、验证external route summarization 配置: C(config)#ip route 172.17.17.0 255.255.255.0 null 0 C(config)#ip route 172.17.18.0 255.255.255.0 null 0 C(config)#ip route 172.17.19.0 255.255.255.0 null 0 C(config-router)#summary-address 172.17.16.0 255.255.252.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-only
8、传播默认路由 C配置一个loopback端口,用于验证默认路由起作用。 C(config)#interface lo 0 C(config-if)#ip address 172.16.0.1 255.255.255.0
配置: C(config-router)#default-information originate always always使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.0 ping C loopback端口(172.16.0.1),验证默认路由起作用
比较配置前后路由表变化 router#show ip route (观察路由表) 见到E2型路由条目
此时不能在A/E执行 (config-router)#area 1 stub建立stub area, OSPF: Stub command is invalid when it is ASBR
因为有type 5 LSA,show ip ospf database可看到。 A/E#show ip ospf database Type-5 AS External Link States 配置成为nssa,使得area 1和10里面只有类型7: A (config-router)#area 10 nssa B(config-router)#area 10 nssa
D (config-router)#area 1 nssa E(config-router)#area 1 nssa
观察配置结果: A/E#show ip ospf database Type-7 AS External Link States (Area 1) (可观察到type 5 type 7)