簡介
本文檔擴展了另一文檔瞭解OSPF中轉發地址的選擇中介紹的概念,並說明了使用NX-OS(Cisco Nexus系列乙太網交換機的網路作業系統)時的區別。
說明
根據上述文檔,使用以下規則在自治系統邊界路由器(ASBR)上選擇轉發地址:
1.如果區域中配置了環回介面,則選擇環回介面的IP地址作為轉發地址(FA)。
2.如果不符合第一個條件,則選擇開放最短路徑優先(OSPF)介面清單上第一個介面的IP地址作為轉發地址。您可以使用show ip ospf interface brief命令檢視OSPF介面清單。頂部介面是連線到OSPF的最後一個介面。
但是,第二個規則不適用於NX-OS。
在NX-OS中,如果沒有環回介面,OSPF介面ID將確定轉發地址。
具有最高ID的介面的IP地址被選為FA,無論該介面是否被動。
請注意,介面ID是動態的,在系統重新載入後可能會更改。
如果某個介面從OSPF中刪除並新增回來,則如果在刪除和新增操作之間將另一個新介面新增到OSPF中,其OSPF介面清單中的ID可能會發生變化。
原因是OSPF介面ID資源被循環使用。
從OSPF介面清單中刪除某個介面後,分配的介面ID將循環使用,即在將另一個介面新增到OSPF介面時,該ID將分配給該介面。
僅當所有回收的ID耗盡時,才會為下一個OSPF介面分配新的介面ID。
範例如下:
show ip ospf interface brief vrf A
OSPF Process ID 10 VRF A
Total number of interface: 4
Interface ID Area Cost State Neighbors Status
Vlan101 452 0.0.0.7 5 BDR 2 up
Vlan201 678 0.0.0.7 100 DR 0 up <—————— highest ID = FA
Vlan301 160 0.0.0.7 100 DR 0 up
Po11 247 0.0.0.7 1000 P2P 1 up
- 從OSPF中刪除VLAN201時,釋放ID 678。
- 然後,當vlan 202新增到OSPF時,ID 678將分配給vlan 202。
- 然後將VLAN 201新增回來,為VLAN 201分配一個更大的新ID。
show ip ospf interface brief vrf B
OSPF Process ID 10 VRF B
Total number of interface: 4
Interface ID Area Cost State Neighbors Status
Vlan102 490 0.0.0.7 5 BDR 2 up <—————— highest ID = FA
Vlan202 51 0.0.0.7 100 DR 0 up
Vlan302 102 0.0.0.7 100 DR 0 up
Po12 275 0.0.0.7 1000 P2P 1 up
interface Vlan101
vrf member A
ip address 192.168.1.1/24 <-----FA
interface Vlan102
vrf member B
ip address 10.1.1.1/24 <---------FA
N7K#show ospf data nssa-external172.16.1.140 det vrf A
OSPF Router with ID () (Process ID 21)
Type-7 AS External Link States (Area 7)
LS age: 162
Options: (No TOS-capability, Type 7/5 translation, No DC)
LS Type: AS External Link
Link State ID: 172.16.1.140 (External Network Number )
Advertising Router: 100.1.1.1
LS Seq Number:80000012
Checksum: 0x504c
Length: 36
Network Mask:255.255.255.255
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 20
Forward Address: 192.168.1.1 ←--- Vlan101
External Route Tag: 0
N7K# show ip ospf data extroute172.16.1.150 det vrf B
OSPF Router with ID () (Process ID 10 VRF B)
Type-5 AS External Link States
LS age: 323
Options: 0x20 (No TOS-capability, DC)
LS Type: Type-5 AS-External
Link State ID:route172.16.1.150 (Network address)
Advertising Router:100.1.1.2
LS Seq Number: 0x8000008f
Checksum: 0x9691
Length: 36
Network Mask: /32
Metric Type: 1 (Same units as link state path)
TOS: 0
Metric: 20
Forward Address: 10.1.1.1 ←--- Vlan 102
External Route Tag: 0