Lab 5-1 Route Import and Control
Lab 5-1 Route Import and Control
Learning Objectives
Topology
Scenario
You are a network administrator of a company. The company's network has OSPF
areas and ISIS areas. To implement network connectivity, configure route import.
When two routing protocols on two devices import routes from each other, some
problems may occur, such as routing loops and sub-optimal routes. To prevent these
problems, you can configure the IP prefix list and route-policy to control routes.
Tasks
Configure IP addresses and masks for physical interfaces and loopback interfaces of
all routers. Each Loopback0 uses the 32-bit mask.
<R1>system-view
[R1-Serial3/0/0]interface LoopBack 0
<R2>system-view
[R2-Serial2/0/0]interface LoopBack 0
<R3>system-view
[R3-Serial3/0/0]interface LoopBack 0
<R4>system-view
[R4-Serial1/0/0]interface LoopBack 0
<R5>system-view
[R5-GigabitEthernet0/0/0]interface LoopBack 0
[R1]ping -c 1 10.0.12.2
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.15.5
1 packet(s) transmitted
1 packet(s) received
[R1]ping -c 1 10.0.14.4
1 packet(s) transmitted
1 packet(s) received
[R2]ping -c 1 10.0.23.3
1 packet(s) transmitted
1 packet(s) received
[R3]ping -c 1 10.0.35.5
1 packet(s) transmitted
1 packet(s) received
Run OSPF on R1, R2, R4, and R5. All devices belong to area 0.
Run OSPF on the network segments connected to R1's S1/0/0, S3/0/0, G0/0/0, and
Loopback0.
[R1]ospf 1
[R1-ospf-1]area 0
[R2]ospf 1
[R2-ospf-1]area 0
Run OSPF on the network segment connected to R4's S1/0/0 and Loopback0.
[R4]ospf 1
[R4-ospf-1]area 0
[R5]ospf 1
[R5-ospf-1]area 0
Check whether the routers can learn the routes from the network segments
connected to Loopback0 of other routers.
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 17 Routes : 17
[R2]display ip routing-table
----------------------------------------------------------------------------
Destinations : 17 Routes : 17
[R4]display ip routing-table
----------------------------------------------------------------------------
Destinations : 12 Routes : 12
[R5]display ip routing-table
----------------------------------------------------------------------------
Destinations : 16 Routes : 16
Run ISIS on the network segments connected to R2's S2/0/0 and Loopback0.
[R2]isis 1
[R2-isis-1]network-entity 49.0001.0000.0000.0002.00
[R2-isis-1]is-level level-2
[R2-isis-1]interface serial2/0/0
[R2-Serial2/0/0]isis enable 1
[R2]interface loopback0
[R2-LoopBack0]isis enable 1
Run ISIS on the network segments connected to R3's S2/0/0, S3/0/0, and Loopback0.
[R3]isis 1
[R3-isis-1]network-entity 49.0001.0000.0000.0003.00
[R3-isis-1]is-level level-2
[R3-isis-1]interface serial2/0/0
[R3-Serial2/0/0]isis enable 1
[R3-Serial2/0/0]interface serial3/0/0
[R3-Serial3/0/0]isis enable 1
[R3-Serial3/0/0]interface loopback0
[R3-LoopBack0]isis enable 1
Run ISIS on the network segments connected to R5's S1/0/0 and Loopback0.
[R5]isis 1
[R5-isis-1]network-entity 49.0001.0000.0000.0005.00
[R5-isis-1]is-level level-2
[R5-isis-1]interface serial1/0/0
[R5-Serial1/0/0]isis enable 1
[R5-Serial1/0/0]interface loopback 0
[R5-LoopBack0]isis enable 1
[R2]display ip routing-table
------------------------------------------------------------------------------
Destinations : 20 Routes : 20
[R3]dis ip routing-table
------------------------------------------------------------------------------
Destinations : 15 Routes : 15
[R5]display ip routing-table
------------------------------------------------------------------------------
Destinations : 19 Routes : 19
[R1]ospf 1
[R1-ospf-1]import-route static
[R4]display ip routing-table
----------------------------------------------------------------------------
Destinations : 17 Routes : 17
Create the routing policy policy_r1 and invoke the prefix list pref_r1 to control static
route import on R1.
[R1-route-policy]ospf
[R4]display ip routing-table
----------------------------------------------------------------------------
Destinations : 13 Routes : 13
Create Loopback 1 with address 10.1.4.4/24 on R4 and run the import-route direct
command to import routes to OSPF.
[R4]interface LoopBack 1
[R4-LoopBack1]ospf 1
[R4-ospf-1]import-route direct
[R2]isis 1
[R2-isis-1]import-route ospf
[R5]ospf
[R5-ospf-1]import-route isis
[R1]ping 10.1.4.4
5 packet(s) transmitted
0 packet(s) received
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 28 Routes : 28
Check the 10.1.4.0/24 route in the routing tables on R2, R3, and R5.
----------------------------------------------------------------------------
Summary Count : 1
------------------------------------------------------------------------------
Summary Count : 1
------------------------------------------------------------------------------
Summary Count : 1
[R1]tracert 10.1.4.4
1 10.0.15.5 61 ms 2 ms 2 ms
2 10.0.35.3 29 ms 28 ms 29 ms
3 10.0.23.2 31 ms 36 ms 36 ms
4 10.0.12.1 34 ms 36 ms 36 ms
5 10.0.15.5 34 ms 37 ms 37 ms
6 10.0.35.3 55 ms 59 ms 59 ms
7 10.0.23.2 60 ms 66 ms 66 ms
8 10.0.12.1 63 ms 66 ms 66 ms
9 10.0.15.5 65 ms 67 ms 67 ms
A loop is detected.
The reason is: After route import is configured, R5 can learn the 10.1.4.0/24 route in
both the ISIS and OSPF domains.
The ISIS routes have higher priority than OSPF external routes, so R5 uses the routes
learned from the ISIS domain.
R1 can learn this route from both R5 and R4. The two routes are OSPF external routes.
Therefore, the cost values of the two routes are compared. R1 is connected to R5
through GE links, which is better than the serial link between R1 and R4. Therefore,
R1 uses the routes learned from R5, causing the loop.
Apply the route policy policy_r5 to R5 and add tag 100 to the route 10.1.4.0/24.
[R5-route-policy]ospf
Routing Tables
Total Nets: 13
R1 has the 10.1.4.0/24 route with tag 100, indicating that the route is obtained from
R5.
To address the loop problem, filter out the 10.1.4.0/24 route when R5 imports ISIS
routes to OSPF.
Configure the route policy route_delete on R5 to control ISIS route import to OSPF.
[R5-route-policy]ospf 1
[R1]display ip routing-table
----------------------------------------------------------------------------
Destinations : 28 Routes : 28
[R1]ping 10.1.4.4
5 packet(s) transmitted
5 packet(s) received
[R1]tracert 10.1.4.4
1 10.0.14.4 61 ms 29 ms 29 ms
The loop is removed. R4 is the next hop of the 10.1.4.0/24 route on R1.
Check the IP routing table of R5. Observe the next hop of the route 10.1.4.0/24.
[R5]display ip routing-table
------------------------------------------------------------------------------
Destinations : 22 Routes : 22
[R5]tracert 10.1.4.4
1 10.0.35.3 62 ms 24 ms 24 ms
2 10.0.23.2 43 ms 44 ms 44 ms
3 10.0.12.1 33 ms 33 ms 33 ms
4 10.0.14.4 74 ms 55 ms 55 ms
Although route filtering can fix the loop problem, R5 still learns the 10.1.4.0/24 route
from the ISIS domain. The sub-optimal route problem still exists.
To fix both the loop problem and sub-optimal route problem, R5 must learn the
10.1.4.0/24 route from the OSPF domain.
Configure the route-policy route_pref on R5. Change the priority of the 10.1.4.0/24
route to 180, which is smaller than the priority of OSPF external routes.
Use the route-policy route_pref to control the ISIS routes imported into OSPF.
[R5]isis
Check the IP routing tables of R5 and R1. Observe the next hops of the 10.1.4.0/24
routes.
----------------------------------------------------------------------------
Summary Count : 1
----------------------------------------------------------------------------
Summary Count : 1
[R1]ping 10.1.4.4
5 packet(s) transmitted
5 packet(s) received
[R1]tracert 10.1.4.4
1 10.0.14.4 61 ms 25 ms 25 ms
[R5]tracert 10.1.4.4
1 10.0.15.1 61 ms 2 ms 2 ms
2 10.0.14.4 41 ms 28 ms 27 ms
R4 is the next hop of the route 10.1.4.0/24 on R1. R1 is the next hop of the route
10.1.4.0/24 on R5. The sub-optimal route problem is also fixed.
----End
Can you use an ACL to achieve the same effect as that in step 3? What is the
difference between using an ACL and a prefix list?
In the R3's routing table in step 5, why the 10.0.15.0/24 route has two next hops but
the 10.0.12.0/24 route has only one next hop?
Device Configurations
<R1>display current-configuration
[V200R007C00SPC600]
sysname R1
interface Serial1/0/0
link-protocol ppp
interface Serial3/0/0
link-protocol ppp
interface GigabitEthernet0/0/0
interface LoopBack0
ospf 1
area 0.0.0.0
return
<R2>display current-configuration
[V200R007C00SPC600]
sysname R2
isis 1
is-level level-2
network-entity 49.0001.0000.0000.0002.00
import-route ospf 1
interface Serial1/0/0
link-protocol ppp
interface Serial2/0/0
link-protocol ppp
isis enable 1
interface LoopBack0
isis enable 1
ospf 1
area 0.0.0.0
return
<R3>display current-configuration
[V200R007C00SPC600]
sysname R3
isis 1
is-level level-2
network-entity 49.0001.0000.0000.0003.00
interface Serial2/0/0
link-protocol ppp
isis enable 1
interface Serial3/0/0
link-protocol ppp
isis enable 1
interface LoopBack0
isis enable 1
<R4>display current-configuration
[V200R007C00SPC600]
sysname R4
interface Serial1/0/0
link-protocol ppp
interface LoopBack0
interface LoopBack1
ospf 1
import-route direct
area 0.0.0.0
return
<R5>display current-configuration
[V200R007C00SPC600]
sysname R5
isis 1
is-level level-2
network-entity 49.0001.0000.0000.0005.00
interface Serial1/0/0
link-protocol ppp
isis enable 1
interface GigabitEthernet0/0/0
interface LoopBack0
isis enable 1
ospf 1
area 0.0.0.0
return