以上圖爲例進行分析:分析的前提均將lo0設爲了router-id,沒做額外的修改。
(1)、首先分析RT2的lo0沒有通告進Area 2,E3/0、E3/1、E3/2、E3/3口通告進了Area 2,RT6的E3/0、E3/1、E3/2、E3/3口通告進了Area 2,lo0通告進Area 0
RT6#show ip ospf database nssa-external
OSPF Router with ID (6.6.6.6) (Process ID 1)
Type-7 AS External Link States (Area 2)
LS age: 23
Options: (No TOS-capability, No Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 0.0.0.0 (External Network Number )
Advertising Router: 6.6.6.6
LS Seq Number: 80000001
Checksum: 0x6221
Length: 36
Network Mask: /0
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 1
Forward Address: 10.2.9.1
External Route Tag: 0
LS age: 22
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 4.4.4.4 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xAA74
Length: 36
Network Mask: /32
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 1000
Forward Address: 10.2.5.1
External Route Tag: 0
LS age: 23
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 172.16.4.0 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xB1BC
Length: 36
Network Mask: /24
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 1000
Forward Address: 10.2.5.1
External Route Tag: 0
RT6#
在這種情況下,轉發地址選擇的是通告進Area 2來的業務網段中最大的一個地址作爲轉發地址。
(2)將業務網段全部改爲重發布,而非直接參與OSPF進程,以外部路由的形式進入OSPF進程。
RT6#show ip ospf database nssa-external
OSPF Router with ID (6.6.6.6) (Process ID 1)
Type-7 AS External Link States (Area 2)
LS age: 34
Options: (No TOS-capability, No Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 0.0.0.0 (External Network Number )
Advertising Router: 6.6.6.6
LS Seq Number: 80000001
Checksum: 0x4E23
Length: 36
Network Mask: /0
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 1
Forward Address: 10.2.26.2
External Route Tag: 0
LS age: 37
Options: (No TOS-capability, No Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 10.2.9.0 (External Network Number )
Advertising Router: 6.6.6.6
LS Seq Number: 80000001
Checksum: 0xF3A
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 10.2.26.2
External Route Tag: 0
Routing Bit Set on this LSA
LS age: 33
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 2.2.2.2 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xA2BC
Length: 36
Network Mask: /32
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 10.2.26.1
External Route Tag: 0
Routing Bit Set on this LSA
LS age: 34
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 4.4.4.4 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x2ED1
Length: 36
Network Mask: /32
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 1000
Forward Address: 10.2.26.1
External Route Tag: 0
RT6#
此時有了明顯的變化,凡是經過RT2通告進來的路由,轉發地址變成了RT2上唯一參與了ospf進程的接口了。RT6上也全是唯一參與Area 2的接口爲轉發地址
(3)、將RT2上的lo0通告進ospf 進程,業務網段仍然以重發布的形式發佈進ospf進程。RT2爲Area 2,RT6 爲Area 0
RT6#show ip ospf database nssa-external
OSPF Router with ID (6.6.6.6) (Process ID 1)
Type-7 AS External Link States (Area 2)
LS age: 25
Options: (No TOS-capability, No Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 0.0.0.0 (External Network Number )
Advertising Router: 6.6.6.6
LS Seq Number: 80000001
Checksum: 0x4E23
Length: 36
Network Mask: /0
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 1
Forward Address: 10.2.26.2
External Route Tag: 0
Routing Bit Set on this LSA
LS age: 26
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 4.4.4.4 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xAA74
Length: 36
Network Mask: /32
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 1000
Forward Address: 2.2.2.2
External Route Tag: 0
Routing Bit Set on this LSA
LS age: 29
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 10.2.2.0 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xCAAD
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 2.2.2.2
External Route Tag: 0
LS age: 31
Options: (No TOS-capability, No Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 10.2.6.0 (External Network Number )
Advertising Router: 6.6.6.6
LS Seq Number: 80000001
Checksum: 0x301C
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 10.2.26.2
External Route Tag: 0
RT6#
由RT2通告的路由轉發地址全部改爲了RT2 的lo0接口。RT6的仍爲唯一參與Area 2的接口地址。
接下來將RT6的lo0改爲Area 2:
RT6#show ip ospf database nssa-external
OSPF Router with ID (6.6.6.6) (Process ID 1)
Type-7 AS External Link States (Area 2)
LS age: 17
Options: (No TOS-capability, No Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 0.0.0.0 (External Network Number )
Advertising Router: 6.6.6.6
LS Seq Number: 80000001
Checksum: 0x85FB
Length: 36
Network Mask: /0
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 1
Forward Address: 6.6.6.6
External Route Tag: 0
Routing Bit Set on this LSA
LS age: 17
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 4.4.4.4 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xAA74
Length: 36
Network Mask: /32
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 1000
Forward Address: 2.2.2.2
External Route Tag: 0
Routing Bit Set on this LSA
LS age: 18
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 10.2.2.0 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xCAAD
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 2.2.2.2
External Route Tag: 0
LS age: 18
Options: (No TOS-capability, No Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 10.2.6.0 (External Network Number )
Advertising Router: 6.6.6.6
LS Seq Number: 80000001
Checksum: 0x67F4
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 6.6.6.6
External Route Tag: 0
RT6#
由RT6始發的路由的轉發地址全部改爲了RT6的lo0接口地址。
(4)、將RT2、RT6上業務網段改爲通告進入ospf進程。
RT6#show ip ospf database nssa-external
OSPF Router with ID (6.6.6.6) (Process ID 1)
Type-7 AS External Link States (Area 2)
LS age: 21
Options: (No TOS-capability, No Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 0.0.0.0 (External Network Number )
Advertising Router: 6.6.6.6
LS Seq Number: 80000001
Checksum: 0x85FB
Length: 36
Network Mask: /0
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 1
Forward Address: 6.6.6.6
External Route Tag: 0
Routing Bit Set on this LSA
LS age: 21
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 4.4.4.4 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xAA74
Length: 36
Network Mask: /32
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 1000
Forward Address: 2.2.2.2
External Route Tag: 0
Routing Bit Set on this LSA
LS age: 22
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 172.16.4.0 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xB1BC
Length: 36
Network Mask: /24
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 1000
Forward Address: 2.2.2.2
External Route Tag: 0
RT6#
發現無論是RT2還是RT6始發的,轉發地址都爲lo0接口的地址。
(5)、爲RT2、RT6上多設置幾個loopback接口,RT2:lo1:7.7.7.7 lo2:8.8.8.8
RT6:lo1:9.9.9.9 lo2:10.10.10.10,全部都發布進Area 2
RT6#show ip ospf database nssa-external
OSPF Router with ID (6.6.6.6) (Process ID 1)
Type-7 AS External Link States (Area 2)
LS age: 16
Options: (No TOS-capability, No Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 0.0.0.0 (External Network Number )
Advertising Router: 6.6.6.6
LS Seq Number: 80000001
Checksum: 0x4E23
Length: 36
Network Mask: /0
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 1
Forward Address: 10.10.10.10
External Route Tag: 0
Routing Bit Set on this LSA
LS age: 117
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 4.4.4.4 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xD72F
Length: 36
Network Mask: /32
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 1000
Forward Address: 8.8.8.8
External Route Tag: 0
Routing Bit Set on this LSA
LS age: 119
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 172.16.4.0 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xDE77
Length: 36
Network Mask: /24
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 1000
Forward Address: 8.8.8.8
External Route Tag: 0
RT6#
此時發現所有的轉發地址都變爲RT2以及RT6上最大的loopback接口地址。
7類LSA轉發地址小結:在lo0也有通告進入該進程該區域的前提下,首選lo0爲轉發地址,如果有多個loopback地址通告進入ospf進程的話,選其中最大的一個爲轉發地址,如果沒有通告則選擇所通告的業務網段中最大的接口ip爲轉發地址,如若也沒有業務網段通告,則選擇自己用來建鄰居所用的接口ip爲轉發地址。