簡介
本文檔介紹在運行Cisco IOS®和IOS-XE®的路由器和交換機上過濾第5類LSA的各種方法。
作者:Rohit Nair,思科TAC工程師。
必要條件
需求
本文件沒有特定需求。
採用元件
本文件所述內容不限於特定軟體和硬體版本。本檔案適用於執行Cisco IOS的所有思科路由器和交換器。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
背景資訊
OSPF第5類LSA由自治系統邊界路由器(ASBR)發起並在OSPF區域內泛洪。這些路由是通過從其他協定重分配到OSPF或通過重分配連線路由或靜態路由生成的。
設定
以下示例顯示了在OSPF域中過濾第5類LSA的各種方法。
網路圖表
初始配置
紐約
interface FastEthernet0/0
ip address 10.12.1.1 255.255.255.0
end
router ospf 1
network 10.12.1.1 0.0.0.0 area 0
[an error occurred while processing this directive]
倫敦
interface FastEthernet0/0
ip address 10.12.1.2 255.255.255.0
end
interface FastEthernet1/0
ip address 10.23.1.1 255.255.255.0
end
router ospf 1
network 10.12.1.2 0.0.0.0 area 0
network 10.23.1.1 0.0.0.0 area 0
[an error occurred while processing this directive]
迪拜
interface FastEthernet0/0
ip address 10.23.1.2 255.255.255.0
end
interface FastEthernet1/0
ip address 192.168.1.1 255.255.255.0
end
router ospf 1
network 10.23.1.2 0.0.0.0 area 0
router eigrp 1
network 192.168.1.1 0.0.0.0
no auto-summary
[an error occurred while processing this directive]
東京
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
end
interface Loopback100
ip address 172.16.1.1 255.255.255.255
end
router eigrp 1
network 172.16.1.1 0.0.0.0
network 192.168.1.2 0.0.0.0
no auto-summary
[an error occurred while processing this directive]
篩選選項
分發清單
與access-list或prefix-list關聯的distribute list out功能可用於生成第5類LSA的ASBR。
附註:OSPF中不支援distribute-list out <interface> 命令。必須使用distribute-list out <protocol>命令。
以下是ASBR迪拜的一個示例。分發清單用於定義從EIGRP在OSPF域內通告哪些網路:
Standard IP access list 1
10 deny 192.168.1.0, wildcard bits 0.0.0.255
20 permit any
router ospf 1
redistribute eigrp 1 subnets
network 10.23.1.2 0.0.0.0 area 0
distribute-list 1 out eigrp 1
[an error occurred while processing this directive]
應用上述分發清單後,紐約和倫敦未檢測到192.168.1.0 LSA:
紐約:
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.1.1 192.168.1.1 23 0x80000001 0x003442 0
NewYork#sh ip route 192.168.1.0
% Network not in table
[an error occurred while processing this directive]
倫敦:
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.1.1 192.168.1.1 152 0x80000001 0x003442 0
London#sh ip route 192.168.1.0
% Network not in table
[an error occurred while processing this directive]
附註:與介面連結的distribute-list可用於區域內的任何路由器。但是,這僅限制路由在路由表中安裝,不會阻止轉發第5類LSA。
Summary-address
在路由器OSPF進程下的ASBR上,可以使用summary-address命令以及not-advertise關鍵字來停止第5類LSA的傳播。
在Dubai上,summary-address命令用於停止172.16.1.0 Type 5LSA的通告。
迪拜:
router ospf 1
log-adjacency-changes
summary-address 172.16.1.0 255.255.255.0 not-advertise
redistribute eigrp 1 subnets
network 10.23.1.2 0.0.0.0 area 0
[an error occurred while processing this directive]
172.16.1.0 LSA在紐約和倫敦不再存在:
紐約:
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
192.168.1.0 192.168.1.1 112 0x80000001 0x0012B8 0
NewYork#sh ip route 172.16.1.0
% Network not in table
[an error occurred while processing this directive]
倫敦:
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
192.168.1.0 192.168.1.1 172 0x80000001 0x0012B8 0
London#sh ip route 172.16.1.0
% Network not in table
[an error occurred while processing this directive]
Route-map
將IGP重新分發到OSPF時,還可以使用路由對映來阻止ASBR上生成第5類LSA。
在Dubai上,從EIGRP重新分發時,會使用路由對映來拒絕192.168.1.0子網通告到OSPF:
迪拜:
Standard IP access list 1
10 deny 192.168.1.0, wildcard bits 0.0.0.255
20 permit any
route-map REDIS, permit, sequence 10
Match clauses:
ip address (access-lists): 1
Set clauses:
Policy routing matches: 0 packets, 0 bytes
router ospf 1
log-adjacency-changes
redistribute eigrp 1 subnets route-map REDIS
network 10.23.1.2 0.0.0.0 area 0
[an error occurred while processing this directive]
未建立192.168.1.0的第5類LSA:
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.1.0 192.168.1.1 47 0x80000001 0x003E39 0
[an error occurred while processing this directive]
驗證
檢查show ip ospf database external命令以確認過濾的LSA是否已被阻止,即可完成驗證。
疑難排解
目前尚無適用於此組態的具體疑難排解資訊。