路由引入原因
由于不同 路由协议之间的路由算法、机制、开销等不同,不同的路由协议之间无法直接分享彼此的路由;
此时就需要通过路由引入技术将某个路由协议的路由引入到另一个路由协议中也可以相同路由协议之间引入
RIP与OSPF 引入位置
在ASBR路由器执行引入指令
OSPF引入RIP
[R8]ospf 1
[R8-ospf-1]imp
[R8-ospf-1]import-route ?
bgp Border Gateway Protocol (BGP) routes
direct Connected routes
isis Intermediate System to Intermediate System (IS-IS) routes
limit Limit the number of routes imported into OSPF
ospf Open Shortest Path First (OSPF) routes
rip Routing Information Protocol (RIP) routes
static Static routes
unr User Network Routes
[R8-ospf-1]import-route rip
RIP引入OSPF
[R8]rip
[R8-rip-1]import-route ospf
RIP路由查看引入OSPF结果
[R9]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 31 Routes : 31
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
2.2.2.2/32 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
3.3.3.3/32 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
5.5.5.5/32 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
6.6.6.6/32 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
7.7.7.7/32 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
8.8.8.0/24 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
9.7.7.0/24 Direct 0 0 D 9.7.7.7 LoopBack2
9.7.7.7/32 Direct 0 0 D 127.0.0.1 LoopBack2
9.7.7.255/32 Direct 0 0 D 127.0.0.1 LoopBack2
9.8.8.0/24 Direct 0 0 D 9.8.8.8 LoopBack1
9.8.8.8/32 Direct 0 0 D 127.0.0.1 LoopBack1
9.8.8.255/32 Direct 0 0 D 127.0.0.1 LoopBack1
9.9.9.0/24 Direct 0 0 D 9.9.9.9 LoopBack0
9.9.9.9/32 Direct 0 0 D 127.0.0.1 LoopBack0
9.9.9.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.1.12.0/24 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
10.1.16.0/24 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
10.1.23.0/24 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
10.1.27.0/24 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
10.1.37.0/24 RIP 100 1 D 10.1.89.1 GigabitEthernet
0/0/0
10.1.89.0/24 Direct 0 0 D 10.1.89.2 GigabitEthernet
0/0/0
10.1.89.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.89.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
12.1.1.0/24 Direct 0 0 D 12.1.1.2 LoopBack3
12.1.1.2/32 Direct 0 0 D 127.0.0.1 LoopBack3
12.1.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack3
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
OSPF区域查看RIP引入结果
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 27 Routes : 27
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 Direct 0 0 D 1.1.1.1 LoopBack0
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
1.1.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
2.2.2.2/32 OSPF 10 1 D 10.1.12.2 GigabitEthernet
0/0/0
3.3.3.3/32 OSPF 10 2 D 10.1.12.2 GigabitEthernet
0/0/0
5.5.5.5/32 OSPF 10 1 D 10.1.12.5 GigabitEthernet
0/0/0
6.6.6.6/32 OSPF 10 48 D 10.1.16.6 Serial2/0/0
7.7.7.7/32 OSPF 10 2 D 10.1.12.2 GigabitEthernet
0/0/0
8.8.8.8/32 OSPF 10 1 D 10.1.12.8 GigabitEthernet
0/0/0
9.7.7.0/24 O_ASE 150 1 D 10.1.12.8 GigabitEthernet
0/0/0
9.8.8.0/24 O_ASE 150 1 D 10.1.12.8 GigabitEthernet
0/0/0
9.9.9.0/24 O_ASE 150 1 D 10.1.12.8 GigabitEthernet
0/0/0
10.1.12.0/24 Direct 0 0 D 10.1.12.1 GigabitEthernet
0/0/0
10.1.12.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
10.1.16.0/24 Direct 0 0 D 10.1.16.1 Serial2/0/0
10.1.16.1/32 Direct 0 0 D 127.0.0.1 Serial2/0/0
10.1.16.6/32 Direct 0 0 D 10.1.16.6 Serial2/0/0
10.1.16.255/32 Direct 0 0 D 127.0.0.1 Serial2/0/0
10.1.23.0/24 OSPF 10 2 D 10.1.12.2 GigabitEthernet
0/0/0
10.1.27.0/24 OSPF 10 2 D 10.1.12.2 GigabitEthernet
0/0/0
10.1.37.0/24 OSPF 10 3 D 10.1.12.2 GigabitEthernet
0/0/0
10.1.89.0/24 O_ASE 150 1 D 10.1.12.8 GigabitEthernet
0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
查看路由表中,某个路由开销、优先级等信息
[R1]display ip routing-table 9.9.9.0 verbose
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination: 9.9.9.0/24
Protocol: O_ASE Process ID: 1
Preference: 150 Cost: 1
NextHop: 10.1.12.8 Neighbour: 0.0.0.0
State: Active Adv Age: 00h22m19s
Tag: 1 Priority: low
Label: NULL QoSInfo: 0x0
IndirectID: 0x0
RelayNextHop: 0.0.0.0 Interface: GigabitEthernet0/0/0
TunnelID: 0x0 Flags: D
[R1]display ip routing-table 9.9.9.0
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
9.9.9.0/24 O_ASE 150 1 D 10.1.12.8 GigabitEthernet
0/0/0
查看OSPF 协议路由类型
[R1]display ospf routing 9.9.9.0
OSPF Process 1 with Router ID 1.1.1.1
Destination : 9.9.9.0/24
AdverRouter : 10.1.12.8 Tag : 1
Cost : 1 Type : Type2
NextHop : 10.1.12.8 Interface : GigabitEthernet0/0/0
Priority : Low Age : 00h24m15s
名称解释
O_ASE : 自治系统外部路由 autonomous system external
O_NSSA: OSPF特殊区域路由