Redistribute Ospf

Scenario to verify RIP redistribute ospf functionality with metric configuration and route-map filtering options.

../../../../_images/redistributeospf1.svg

Test RIP Redistribute OSPF

Description

Test RIP redistribute ospf basic functionality across three routers. DUT1 (OSPF) announces a dummy interface route via OSPF. DUT0 (OSPF + RIP) learns the route via OSPF and redistributes it to RIP. DUT2 (RIP only) learns the OSPF route through RIP redistribution.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.1.1.100/24
set interfaces ethernet eth1 address 10.2.2.100/24
set protocols ospf area 0 network 10.1.1.0/24
set protocols rip network 10.2.2.0/24
set protocols rip redistribute ospf
set protocols rip timers update 5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 192.168.100.1/24
set interfaces ethernet eth0 address 10.1.1.1/24
set protocols ospf area 0 network 10.1.1.0/24
set protocols ospf redistribute connected
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Set the following configuration in DUT2 :

set interfaces ethernet eth1 address 10.2.2.2/24
set protocols rip network 10.2.2.0/24
set protocols rip timers update 5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify OSPF neighbor is established between DUT0 and DUT1

Step 4: Run command protocols ospf show neighbor at DUT0 and check if output matches the following regular expressions:

10.1.1.1
Show output
Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
192.168.100.1     1 2-Way/DROther   1.661s            38.338s 10.1.1.1        eth0:10.1.1.100                      0     0     0

Attention

Verify DUT0 learns the OSPF route 192.168.100.0/24 from DUT1

Step 5: Run command protocols ip show route at DUT0 and check if output matches the following regular expressions:

192.168.100.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
O   10.1.1.0/24 [110/10] is directly connected, eth0, weight 1, 00:00:49
C>* 10.1.1.0/24 is directly connected, eth0, weight 1, 00:00:49
K * 10.1.1.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:49
L>* 10.1.1.100/32 is directly connected, eth0, weight 1, 00:00:49
C>* 10.2.2.0/24 is directly connected, eth1, weight 1, 00:00:49
K * 10.2.2.0/24 [0/0] is directly connected, eth1, weight 1, 00:00:49
L>* 10.2.2.100/32 is directly connected, eth1, weight 1, 00:00:49
O>* 192.168.100.0/24 [110/20] via 10.1.1.1, eth0, weight 1, 00:00:01

Attention

Verify DUT2 learns the redistributed OSPF route 192.168.100.0/24 via RIP

Step 6: Run command protocols rip show at DUT2 and check if output matches the following regular expressions:

R\(n\) +192.168.100.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct
Sub-codes:
      (n) - normal, (s) - static, (d) - default, (r) - redistribute,
      (i) - interface

     Network            Next Hop         Metric From            Tag Time
C(i) 10.2.2.0/24        0.0.0.0               1 self              0
R(n) 192.168.100.0/24   10.2.2.100            2 10.2.2.100        0 02:58

Step 7: Run command protocols ip show route at DUT2 and check if output matches the following regular expressions:

R>\* +192.168.100.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
C>* 10.2.2.0/24 is directly connected, eth1, weight 1, 00:00:47
L>* 10.2.2.2/32 is directly connected, eth1, weight 1, 00:00:47
R>* 192.168.100.0/24 [120/2] via 10.2.2.100, eth1, weight 1, 00:00:02

Test RIP Redistribute OSPF With Metric

Description

Test RIP redistribute ospf metric with a custom value (metric 5). DUT0 redistributes OSPF routes with metric 5. DUT2 learns the route with metric 6 (incremented by 1 hop).

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.1.1.100/24
set interfaces ethernet eth1 address 10.2.2.100/24
set protocols ospf area 0 network 10.1.1.0/24
set protocols rip network 10.2.2.0/24
set protocols rip redistribute ospf metric 5
set protocols rip timers update 5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 192.168.100.1/24
set interfaces ethernet eth0 address 10.1.1.1/24
set protocols ospf area 0 network 10.1.1.0/24
set protocols ospf redistribute connected
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Set the following configuration in DUT2 :

set interfaces ethernet eth1 address 10.2.2.2/24
set protocols rip network 10.2.2.0/24
set protocols rip timers update 5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify OSPF neighbor is established between DUT0 and DUT1

Step 4: Run command protocols ospf show neighbor at DUT0 and check if output matches the following regular expressions:

10.1.1.1
Show output
Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
192.168.100.1     1 Init/DROther    1.337s            38.662s 10.1.1.1        eth0:10.1.1.100                      0     0     0

Attention

Verify DUT0 learns the OSPF route 192.168.100.0/24 from DUT1

Step 5: Run command protocols ip show route at DUT0 and check if output matches the following regular expressions:

192.168.100.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
O   10.1.1.0/24 [110/10] is directly connected, eth0, weight 1, 00:00:49
C>* 10.1.1.0/24 is directly connected, eth0, weight 1, 00:00:49
K * 10.1.1.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:49
L>* 10.1.1.100/32 is directly connected, eth0, weight 1, 00:00:49
C>* 10.2.2.0/24 is directly connected, eth1, weight 1, 00:00:49
K * 10.2.2.0/24 [0/0] is directly connected, eth1, weight 1, 00:00:49
L>* 10.2.2.100/32 is directly connected, eth1, weight 1, 00:00:49
O>* 192.168.100.0/24 [110/20] via 10.1.1.1, eth0, weight 1, 00:00:01

Attention

Verify DUT2 learns route 192.168.100.0/24 with metric 6

Step 6: Run command protocols rip show at DUT2 and check if output matches the following regular expressions:

R\(n\) +192.168.100.0/24\s+10.2.2.100\s+6\s+10.2.2.100
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct
Sub-codes:
      (n) - normal, (s) - static, (d) - default, (r) - redistribute,
      (i) - interface

     Network            Next Hop         Metric From            Tag Time
C(i) 10.2.2.0/24        0.0.0.0               1 self              0
R(n) 192.168.100.0/24   10.2.2.100            6 10.2.2.100        0 02:58

Test RIP Redistribute OSPF Metric 16 Route Not Announced

Description

Test RIP redistribute ospf metric 16 - route is not announced. When DUT0 redistributes OSPF routes with metric 16 (infinity), the routes are not announced to RIP neighbors. DUT2 does not see the route.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.1.1.100/24
set interfaces ethernet eth1 address 10.2.2.100/24
set protocols ospf area 0 network 10.1.1.0/24
set protocols rip network 10.2.2.0/24
set protocols rip redistribute ospf metric 16
set protocols rip timers update 5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 192.168.100.1/24
set interfaces ethernet eth0 address 10.1.1.1/24
set protocols ospf area 0 network 10.1.1.0/24
set protocols ospf redistribute connected
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Set the following configuration in DUT2 :

set interfaces ethernet eth1 address 10.2.2.2/24
set protocols rip network 10.2.2.0/24
set protocols rip timers update 5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify OSPF neighbor is established between DUT0 and DUT1

Step 4: Run command protocols ospf show neighbor at DUT0 and check if output matches the following regular expressions:

10.1.1.1
Show output
Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
192.168.100.1     1 Init/DROther    1.323s            38.676s 10.1.1.1        eth0:10.1.1.100                      0     0     0

Attention

Verify DUT0 learns the OSPF route 192.168.100.0/24 from DUT1

Step 5: Run command protocols ip show route at DUT0 and check if output matches the following regular expressions:

192.168.100.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
O   10.1.1.0/24 [110/10] is directly connected, eth0, weight 1, 00:00:49
C>* 10.1.1.0/24 is directly connected, eth0, weight 1, 00:00:49
K * 10.1.1.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:49
L>* 10.1.1.100/32 is directly connected, eth0, weight 1, 00:00:49
C>* 10.2.2.0/24 is directly connected, eth1, weight 1, 00:00:49
K * 10.2.2.0/24 [0/0] is directly connected, eth1, weight 1, 00:00:49
L>* 10.2.2.100/32 is directly connected, eth1, weight 1, 00:00:49
O>* 192.168.100.0/24 [110/20] via 10.1.1.1, eth0, weight 1, 00:00:02

Attention

Verify DUT2 does not see route 192.168.100.0/24 in RIP database

Step 6: Run command protocols rip show at DUT2 and expect this output:

Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct
Sub-codes:
      (n) - normal, (s) - static, (d) - default, (r) - redistribute,
      (i) - interface

     Network            Next Hop         Metric From            Tag Time
C(i) 10.2.2.0/24        0.0.0.0               1 self              0

Test RIP Redistribute OSPF With Route-Map

Description

Test RIP redistribute ospf route-map filtering functionality. DUT1 announces two dummy routes (dum0 and dum1) via OSPF. DUT0 uses a route-map to only redistribute 192.168.100.0/24 to RIP. DUT2 learns only the matching route, while 192.168.200.0/24 is filtered out.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.1.1.100/24
set interfaces ethernet eth1 address 10.2.2.100/24
set protocols ip prefix-list ALLOW-DUM0 rule 1 action permit
set protocols ip prefix-list ALLOW-DUM0 rule 1 prefix 192.168.100.0/24
set protocols ospf area 0 network 10.1.1.0/24
set protocols rip network 10.2.2.0/24
set protocols rip redistribute ospf route-map FILTER-OSPF
set protocols rip timers update 5
set protocols route-map FILTER-OSPF rule 1 action permit
set protocols route-map FILTER-OSPF rule 1 match ip address prefix-list ALLOW-DUM0
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT1 :

set interfaces dummy dum0 address 192.168.100.1/24
set interfaces dummy dum1 address 192.168.200.1/24
set interfaces ethernet eth0 address 10.1.1.1/24
set protocols ospf area 0 network 10.1.1.0/24
set protocols ospf redistribute connected
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 3: Set the following configuration in DUT2 :

set interfaces ethernet eth1 address 10.2.2.2/24
set protocols rip network 10.2.2.0/24
set protocols rip timers update 5
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify OSPF neighbor is established between DUT0 and DUT1

Step 4: Run command protocols ospf show neighbor at DUT0 and check if output matches the following regular expressions:

10.1.1.1
Show output
Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
192.168.200.1     1 2-Way/DROther   1.685s            38.314s 10.1.1.1        eth0:10.1.1.100                      0     0     0

Attention

Verify DUT0 learns both OSPF routes from DUT1

Step 5: Run command protocols ip show route at DUT0 and check if output matches the following regular expressions:

192.168.100.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
O   10.1.1.0/24 [110/10] is directly connected, eth0, weight 1, 00:00:49
C>* 10.1.1.0/24 is directly connected, eth0, weight 1, 00:00:50
K * 10.1.1.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:50
L>* 10.1.1.100/32 is directly connected, eth0, weight 1, 00:00:50
C>* 10.2.2.0/24 is directly connected, eth1, weight 1, 00:00:50
K * 10.2.2.0/24 [0/0] is directly connected, eth1, weight 1, 00:00:50
L>* 10.2.2.100/32 is directly connected, eth1, weight 1, 00:00:50
O>* 192.168.100.0/24 [110/20] via 10.1.1.1, eth0, weight 1, 00:00:02
O>* 192.168.200.0/24 [110/20] via 10.1.1.1, eth0, weight 1, 00:00:02

Step 6: Run command protocols ip show route at DUT0 and check if output matches the following regular expressions:

192.168.200.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
O   10.1.1.0/24 [110/10] is directly connected, eth0, weight 1, 00:00:49
C>* 10.1.1.0/24 is directly connected, eth0, weight 1, 00:00:50
K * 10.1.1.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:50
L>* 10.1.1.100/32 is directly connected, eth0, weight 1, 00:00:50
C>* 10.2.2.0/24 is directly connected, eth1, weight 1, 00:00:50
K * 10.2.2.0/24 [0/0] is directly connected, eth1, weight 1, 00:00:50
L>* 10.2.2.100/32 is directly connected, eth1, weight 1, 00:00:50
O>* 192.168.100.0/24 [110/20] via 10.1.1.1, eth0, weight 1, 00:00:02
O>* 192.168.200.0/24 [110/20] via 10.1.1.1, eth0, weight 1, 00:00:02

Attention

Verify DUT2 learns only 192.168.100.0/24 (matching route-map)

Step 7: Run command protocols rip show at DUT2 and check if output matches the following regular expressions:

R\(n\) +192.168.100.0/24
Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct
Sub-codes:
      (n) - normal, (s) - static, (d) - default, (r) - redistribute,
      (i) - interface

     Network            Next Hop         Metric From            Tag Time
C(i) 10.2.2.0/24        0.0.0.0               1 self              0
R(n) 192.168.100.0/24   10.2.2.100            2 10.2.2.100        0 02:58

Attention

Verify DUT2 does NOT learn 192.168.200.0/24 (filtered by route-map)

Step 8: Run command protocols rip show at DUT2 and expect this output:

Show output
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct
Sub-codes:
      (n) - normal, (s) - static, (d) - default, (r) - redistribute,
      (i) - interface

     Network            Next Hop         Metric From            Tag Time
C(i) 10.2.2.0/24        0.0.0.0               1 self              0
R(n) 192.168.100.0/24   10.2.2.100            2 10.2.2.100        0 02:58