配置在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)