以上图为例进行分析:分析的前提均将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为转发地址。