2.外部路由
[R6-ospf-1]import-route direct
<R1>dis ospf lsdb ase 6.6.6.6
OSPF Process 1 with Router ID 0.0.0.1
Link State Database
Type : External
Ls id : 6.6.6.6 //路由
Adv rtr : 0.0.0.6 //ASBR的RID
Ls age : 109
Len : 36
Options : E
seq# : 80000001
chksum : 0xc5ec
Net mask : 255.255.255.255
TOS 0 Metric: 1 //度量值默认为1,OSPF外部路由类型2,cost在域内不累加
E type : 2 //类型为外部类型2,类型1在区域内累加
Forwarding Address : 0.0.0.0 //转发地址,即下一跳,如果是0.0.0.0的话就参照正常的路由(指向ASBR)
Tag : 1
Priority : Medium
5类LSA,
通告者:ASBR
传输范围:整个OSPF domain(域)
内容和功能:描述外部路由
如果外部类型类型相同,cost相同,会优选较大的区域ID
[R1-ospf-1]import-route direct cost 10 tag 11 type 1
dis ip rou 1.1.1.1 ver
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination: 1.1.1.1/32
Protocol: O_ASE Process ID: 1
Preference: 150 Cost: 59
NextHop: 10.1.35.5 Neighbour: 0.0.0.0
State: Active Adv Age: 00h00m15s
Tag: 11 Priority: medium
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: GigabitEthernet0/0/0
TunnelID: 0x0 Flags: D
4类LSA,
通告者:ASBR所在区域的ABR
传输范围:除了ASBR所在区域,整个OSPF domain(域)
内容和功能:描述ASBR的RID
ospf 1 router-id 5.5.5.5
peer 10.1.1.1
area 0.0.0.0
area 0.0.0.15
area 0.0.0.35
area 0.0.0.56
network 10.1.56.5 0.0.0.0
---------------------------
普通区域的转发地址
[R1]dis ospf lsdb ase 6.6.6.6
OSPF Process 1 with Router ID 0.0.0.1
Link State Database
Type : External
Ls id : 6.6.6.6
Adv rtr : 10.1.15.3
Ls age : 216
Len : 36
Options : E
seq# : 80000001
chksum : 0x90eb
Net mask : 255.255.255.255
TOS 0 Metric: 1
E type : 2
Forwarding Address : 10.1.15.5 //非0,路由表的下一跳为转发地址,实现了转发的优化
Tag : 1
Priority : Medium
某些监管下,一定要求流量从一个接入、再转出
interface Vlanif15
ip address 10.1.15.3 255.255.255.0
ospf network-type p2p
ospf enable 1 area 0.0.0.15
[R1-GigabitEthernet0/0/1]dis ospf lsdb ase 6.6.6.6
OSPF Process 1 with Router ID 0.0.0.1
Link State Database
Type : External
Ls id : 6.6.6.6
Adv rtr : 10.1.15.3
Ls age : 68
Len : 36
Options : E
seq# : 80000002
chksum : 0xa90
Net mask : 255.255.255.255
TOS 0 Metric: 1
E type : 2
Forwarding Address : 0.0.0.0 //转发地址为0.0.0.0
Tag : 1
Priority : Medium
[R1-GigabitEthernet0/0/1]dis ip rou 6.6.6.6
Route Flags: R - relay, D - download to fib
作业:验证转发的地址两种场景0.0.0.0和非0
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface