CÔNG TY TNHH CÔNG NGHỆ VIỆT THÁI DƯƠNG
Logo CNTTShop.vn

NTT03, Line 1, Thống Nhất Complex, Thanh Xuân, Hà Nội.
Danh mục sản phẩm

Configure OSPF Multi-Processes

Network Requirements

  • Configure OSPF on all devices. On Device2, enable two OSPF processes. Configure OSPF 100 of Device1 and that of Device2 to set up a neighbor relation. Configure OSPF 200 of Device3 and that of Device2 to set up a neighbor relation.
  • The two OSPF processes on Device2 redistribute routes to each other. OSPF process 100 uses a routing policy to control to redistribute only route 110.0.0.0/24. OSPF process 200 uses a routing policy to control to redistribute only route 100.0.0.0/24.

Network Topology

Networking for Configuring OSPF Multi-Processes

Figure 7-4 Networking for Configuring OSPF Multi-Processes

Configuration Steps

Step 1: Create VLANs, and add ports to the required VLANs. (Omitted)

Step 2: Configure IP addresses for the ports. (Omitted)

Step 3: Configure the OSPF protocol.

#Configure Device1.

Device1#configure terminal
Device1(config)#router ospf 100
Device1(config-ospf)#router-id 1.1.1.1
Device1(config-ospf)#network 10.0.0.0 0.0.0.255 area 0
Device1(config-ospf)#network 100.0.0.0 0.0.0.255 area 0
Device1(config-ospf)#network 100.1.0.0 0.0.0.255 area 0
Device1(config-ospf)#exit

#On Device2, create two OSPF processes, process 100 and process 200.

Device2#configure terminal
Device2(config)#router ospf 100
Device2(config-ospf)#router-id 2.2.2.2
Device2(config-ospf)#network 10.0.0.0 0.0.0.255 area 0
Device2(config-ospf)#exit
Device2(config)#router ospf 200
Device2(config-ospf)#router-id 2.2.2.3
Device2(config-ospf)#network 20.0.0.0 0.0.0.255 area 0
Device2(config-ospf)#exit

#Configure Device3.

Device3#configure terminal
Device3(config)#router ospf 200
Device3(config-ospf)#router-id 3.3.3.3
Device3(config-ospf)#network 20.0.0.0 0.0.0.255 area 0
Device3(config-ospf)#network 110.0.0.0 0.0.0.255 area 0
Device3(config-ospf)#network 110.1.0.0 0.0.0.255 area 0
Device3(config-ospf)#exit

note


  • If there are multiple OSPF processes, it is recommended that you configure different Router IDs for the OSPF processes to prevent Router ID conflict.

#Query the LSDB and neighbor information of Device2.

Device2#show ip ospf neighbor
OSPF process 100: 
Neighbor ID    Pri   State          Dead Time   Address     Interface
1.1.1.1        1     Full/Backup    00:00:30	10.0.0.1    vlan2 
OSPF process 200: 
Neighbor ID    Pri   State          Dead Time   Address     Interface
3.3.3.3        1     Full/DR        00:00:33    20.0.0.2    vlan3 
 
Device2#show ip ospf database  
 
            OSPF Router with ID (2.2.2.2) (Process ID 100) 
 
                Router Link States (Area 0) 
 
Link ID    ADV Router    Age  Seq#        CkSum   Link count
1.1.1.1    1.1.1.1       19   0x80000016  0x53bf  3  
2.2.2.2    2.2.2.2       15   0x80000010  0x1ae1  1  
 
                Net Link States (Area 0) 
 
Link ID    ADV Router    Age  Seq#        CkSum
10.0.0.2   2.2.2.2       21   0x80000001  0x43d6  
 
            OSPF Router with ID (2.2.2.3) (Process ID 200) 
 
                Router Link States (Area 0) 
 
Link ID    ADV Router    Age  Seq#        CkSum   Link count
2.2.2.3    2.2.2.3       14   0x8000000f  0xb235  1  
3.3.3.3    3.3.3.3       15   0x8000001b  0x696b  3  
 
                Net Link States (Area 0) 
              
Link ID    ADV Router    Age  Seq#        CkSum
20.0.0.2   3.3.3.3       15   0x80000002  0x03fe 

Neighbors have been set up respectively for OSPF 100 and OSPF 200 of Device2, and the two processes have their respective OSPF databases.

#Query the OSPF routing table of Device2.

Device2#show ip ospf route
OSPF process 100: 
Codes: C - connected, D - Discard, O - OSPF, IA OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 OSPF NSSA external type 2 
       E1 - OSPF external type 1, E2 OSPF external type 2 
 
O 10.0.0.0/24 [1] is directly connected, vlan2, Area 0
O 100.0.0.0/24 [2] via 10.0.0.1, vlan2, Area 0 
O 100.1.0.0/24 [2] via 10.0.0.1, vlan2, Area 0
OSPF process 200: 
Codes: C - connected, D - Discard, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 
       E1 - OSPF external type 1, E2 - OSPF external type 2 
 
O 20.0.0.0/24 [1] is directly connected, vlan3, Area 0
O 110.0.0.0/24 [2] via 20.0.0.2, vlan3, Area 0 
O 110.1.0.0/24 [2] via 20.0.0.2, vlan3, Area 0 

OSPF process 100 and process 200 have calculated their own routes.

#Query the routing table of Device2.

Device2#show ip route  
Codes: C - connected, S - static, R - RIP, O - OSPF, OE-OSPF External, M - Management 
       D - Redirect, E - IRMP, EX - IRMP external, o - SNSP, B - BGP, i-ISIS  
 
Gateway of last resort is not set 
 
C 10.0.0.0/24 is directly connected, 00:05:34, vlan2 
C 20.0.0.0/24 is directly connected, 00:05:28, vlan3
O 100.0.0.0/24 [110/2] via 10.0.0.1, 00:04:42, vlan2
O 100.1.0.0/24 [110/2] via 10.0.0.1, 00:04:42, vlan2
O 110.0.0.0/24 [110/2] via 20.0.0.2, 00:04:41, vlan3
O 110.1.0.0/24 [110/2] via 20.0.0.2, 00:04:41, vlan3
C 127.0.0.0/8 is directly connected, 48:40:33, lo0 

Step 4: Configure the routing policy.

#Configure Device2.

Device2(config)#ip prefix-list 1 permit 110.0.0.0/24
Device2(config)#ip prefix-list 2 permit 100.0.0.0/24
Device2(config)#route-map OSPF200to100
Device2(config-route-map)#match ip address prefix-list 1
Device2(config-route-map)#exit
Device2(config)#route-map OSPF100to200
Device2(config-route-map)#match ip address prefix-list 2
Device2(config-route-map)#exit

The route-maps have been configured to invoke prefix list 1 and prefix list 2 to match network segment 110.0.0.0/24 and 100.0.0.0/24 respectively.

note

  • In configuring a routing policy, you can create a filtration rule based on a prefix list or ACL. The prefix list can precisely match routing masks while the ACL cannot match routing masks.

Step 5: Configure OSPF processes to redistribute RIP routes to each other and associate routing policies.

#Configure Device2.

Device2(config)#router ospf 100
Device2(config-ospf)#redistribute ospf 200 route-map OSPF200to100
Device2(config-ospf)#exit
Device2(config)#router ospf 200
Device2(config-ospf)#redistribute ospf 100 route-map OSPF100to200
Device2(config-ospf)#exit

Step 6: Check the result.

#Query OSPF LSDB of Device2.

Device2#show ip ospf database  
 
            OSPF Router with ID (2.2.2.2) (Process ID 100) 
 
                Router Link States (Area 0) 
 
Link ID    ADV Router    Age   Seq#        CkSum   Link count
1.1.1.1	   1.1.1.1       1663  0x80000016  0x53bf  3  
2.2.2.2    2.2.2.2       216   0x80000011  0x1eda  1  
 
                Net Link States (Area 0) 
 
Link ID    ADV Router    Age   Seq#        CkSum
10.0.0.2   2.2.2.2       1664  0x80000001  0x43d6  
 
                AS External Link States  
 
Link ID    ADV Router    Age   Seq#        CkSum Route 
110.0.0.0  2.2.2.2       216   0x80000001  0x3dfc E2 110.0.0.0/24 [0x0]  
 
            OSPF Router with ID (2.2.2.3) (Process ID 200) 
 
                Router Link States (Area 0) 
 
Link ID     ADV Router   Age   Seq#        CkSum   Link count
2.2.2.3     2.2.2.3      205   0x80000010  0xb62e  1  
3.3.3.3     3.3.3.3      1658  0x8000001b  0x696b  3  
 
                Net Link States (Area 0) 
 
Link ID     ADV Router   Age   Seq#        CkSum
20.0.0.2    3.3.3.3      1658  0x80000002  0x03fe  
 
                AS External Link States  
 
Link ID     ADV Router   Age   Seq#         CkSum Route 
100.0.0.0   2.2.2.3      205   0x80000001   0xb989 E2 100.0.0.0/24 [0x0] 

According to the queried information, OSPF process 100 has only the LSA of external route 110.0.0.0/24, and the other routes 110.1.0.0/24 and 20.0.0.0/24 have been filtered out by the routing policy OSPF200to100. Similarly, OSPF process 200 has only the LSA of external route 100.0.0.0/24, and the other routes 100.1.0.0/24 and 10.0.0.0/24 have been filtered out by the routing policy OSPF100to200.

#Query the routing table of Device1.

Device1#show ip route  
Codes: C - connected, S - static, R - RIP, O - OSPF, OE-OSPF External, M Management 
       D - Redirect, E - IRMP, EX - IRMP external, o - SNSP, B BGP, i-ISIS  
 
Gateway of last resort is not set 
 
C  10.0.0.0/24 is directly connected, 00:40:20, vlan2 
C  100.0.0.0/24 is directly connected, 03:11:36, vlan3
C  100.1.0.0/24 is directly connected, 01:00:22, vlan4
OE 110.0.0.0/24 [150/2] via 10.0.0.2, 00:15:27, vlan2
C  127.0.0.0/8 is directly connected, 97:08:23, lo0

Device1 has only learnt route 110.0.0.0/24.

#Query the routing table of Device3.

Device3#show ip route  
Codes: C - connected, S - static, R - RIP, O - OSPF, OE-OSPF External, M Management 
       D - Redirect, E - IRMP, EX - IRMP external, o - SNSP, B BGP, i-ISIS  
 
Gateway of last resort is not set 
 
C  20.0.0.0/24 is directly connected, 00:42:44, vlan2
OE 100.0.0.0/24 [150/2] via 20.0.0.1, 00:17:45, vlan2
C  110.0.0.0/24 is directly connected, 01:02:03, vlan3
C  110.1.0.0/24 is directly connected, 01:02:14, vlan4
C  127.0.0.0/8 is directly connected, 41:02:01, lo0 

Device3 has only learnt route 100.0.0.0/24.

caution


  • In an actual application, if there are two or more AS boundary routers, it is recommended that you do not redistribute routes between different OSPF processes. If you really need to redistribute routes between different OSPF processes, configure a route filtration policy to prevent routing loops.