Redistribute Rip

Scenario to verify BGP redistribute rip functionality with metric and route-map filtering options.

../../../../_images/redistributerip.svg

Test BGP Redistribute RIP iBGP

Description

Test BGP redistribute rip with iBGP. DUT0 runs RIP and announces a dummy interface route. DUT1 (RIP + BGP AS 10) learns the route via RIP and redistributes it into BGP. DUT2 (BGP AS 10) learns the RIP route through iBGP redistribution.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 192.168.100.1/24
set interfaces ethernet eth0 address 10.1.1.1/24
set protocols rip network 10.1.1.0/24
set protocols rip redistribute connected
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 ethernet eth0 address 10.1.1.100/24
set interfaces ethernet eth1 address 10.2.2.100/24
set protocols bgp 10 neighbor peer nexthop-self
set protocols bgp 10 neighbor peer remote-address 10.2.2.2
set protocols bgp 10 neighbor peer remote-as 10
set protocols bgp 10 redistribute rip
set protocols rip network 10.1.1.0/24
set protocols rip timers update 5
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 bgp 10 neighbor peer remote-address 10.2.2.100
set protocols bgp 10 neighbor peer remote-as 10
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify DUT1 learns the RIP route 192.168.100.0/24 from DUT0

Step 4: Run command protocols rip show at DUT1 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.1.1.0/24        0.0.0.0               1 self              0
R(n) 192.168.100.0/24   10.1.1.1              2 10.1.1.1          0 02:59

Attention

Verify BGP session is established between DUT1 and DUT2

Step 5: Run command protocols bgp show ip summary at DUT1 and check if output matches the following regular expressions:

10.2.2.2.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.2.2.100, local AS number 10 VRF default vrf-id 0
BGP table version 1
RIB entries 1, using 128 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
10.2.2.2        10.2.2.100      4         10         3         4        1    0    0 00:00:02  Established        0        1 FRRouting/10.4.1

Total number of neighbors 1

Attention

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

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

192.168.100.0/24
Show output
BGP table version is 1, local router ID is 10.2.2.2, vrf id 0
Default local pref 100, local AS 10
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 192.168.100.0/24 10.2.2.100               2    100      0 ?

Displayed 1 routes and 1 total paths

Attention

Verify that route is installed in routing table

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

B.+ 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:03
L>* 10.2.2.2/32 is directly connected, eth1, weight 1, 00:00:03
B>* 192.168.100.0/24 [200/2] via 10.2.2.100, eth1, weight 1, 00:00:01

Test BGP Redistribute RIP eBGP

Description

Test BGP redistribute rip with eBGP. DUT0 runs RIP and announces a dummy interface route. DUT1 (RIP + BGP AS 10) learns the route via RIP and redistributes it into BGP. DUT2 (BGP AS 20) learns the RIP route through eBGP redistribution.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 192.168.100.1/24
set interfaces ethernet eth0 address 10.1.1.1/24
set protocols rip network 10.1.1.0/24
set protocols rip redistribute connected
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 ethernet eth0 address 10.1.1.100/24
set interfaces ethernet eth1 address 10.2.2.100/24
set protocols bgp 10 neighbor peer remote-address 10.2.2.2
set protocols bgp 10 neighbor peer remote-as 20
set protocols bgp 10 neighbor peer route-map export PERMIT
set protocols bgp 10 redistribute rip
set protocols rip network 10.1.1.0/24
set protocols rip timers update 5
set protocols route-map PERMIT rule 1 action permit
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 bgp 20 neighbor peer remote-address 10.2.2.100
set protocols bgp 20 neighbor peer remote-as 10
set protocols bgp 20 neighbor peer route-map import PERMIT
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify DUT1 learns the RIP route 192.168.100.0/24 from DUT0

Step 4: Run command protocols rip show at DUT1 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.1.1.0/24        0.0.0.0               1 self              0
R(n) 192.168.100.0/24   10.1.1.1              2 10.1.1.1          0 02:59

Attention

Verify BGP session is established between DUT1 and DUT2

Step 5: Run command protocols bgp show ip summary at DUT1 and check if output matches the following regular expressions:

10.2.2.2.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.2.2.100, local AS number 10 VRF default vrf-id 0
BGP table version 1
RIB entries 1, using 128 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
10.2.2.2        10.2.2.100      4         20         2         2        0    0    0 00:00:00  Established (Policy)        0 N/A

Total number of neighbors 1

Attention

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

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

[*]>\s+192.168.100.0/24
Show output
BGP table version is 1, local router ID is 10.2.2.2, vrf id 0
Default local pref 100, local AS 20
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.100.0/24 10.2.2.100               2             0 10 ?

Displayed 1 routes and 1 total paths

Attention

Verify that route is installed in routing table

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

B>[*]\s+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:02
K * 10.2.2.0/24 [0/0] is directly connected, eth1, weight 1, 00:00:02
L>* 10.2.2.2/32 is directly connected, eth1, weight 1, 00:00:02
B>* 192.168.100.0/24 [20/2] via 10.2.2.100, eth1, weight 1, 00:00:01

Test BGP Redistribute RIP With Metric iBGP

Description

Test BGP redistribute rip metric with iBGP. DUT1 redistributes RIP routes with metric 100 (MED). DUT2 learns the route with MED 100.

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 192.168.100.1/24
set interfaces ethernet eth0 address 10.1.1.1/24
set protocols rip network 10.1.1.0/24
set protocols rip redistribute connected
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 ethernet eth0 address 10.1.1.100/24
set interfaces ethernet eth1 address 10.2.2.100/24
set protocols bgp 10 neighbor peer nexthop-self
set protocols bgp 10 neighbor peer remote-address 10.2.2.2
set protocols bgp 10 neighbor peer remote-as 10
set protocols bgp 10 redistribute rip metric 100
set protocols rip network 10.1.1.0/24
set protocols rip timers update 5
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 bgp 10 neighbor peer remote-address 10.2.2.100
set protocols bgp 10 neighbor peer remote-as 10
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify DUT1 learns the RIP route 192.168.100.0/24 from DUT0

Step 4: Run command protocols rip show at DUT1 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.1.1.0/24        0.0.0.0               1 self              0
R(n) 192.168.100.0/24   10.1.1.1              2 10.1.1.1          0 02:59

Attention

Verify BGP session is established between DUT1 and DUT2

Step 5: Run command protocols bgp show ip summary at DUT1 and check if output matches the following regular expressions:

10.2.2.2.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.2.2.100, local AS number 10 VRF default vrf-id 0
BGP table version 1
RIB entries 1, using 128 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
10.2.2.2        10.2.2.100      4         10         3         5        1    0    0 00:00:02  Established        0        1 FRRouting/10.4.1

Total number of neighbors 1

Attention

Verify DUT2 learns route 192.168.100.0/24 with MED 100

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

[*]>i\s+192.168.100.0/24.+\s100\s
Show output
BGP table version is 1, local router ID is 10.2.2.2, vrf id 0
Default local pref 100, local AS 10
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 192.168.100.0/24 10.2.2.100             100    100      0 ?

Displayed 1 routes and 1 total paths

Test BGP Redistribute RIP With Metric eBGP

Description

Test BGP redistribute rip metric with eBGP. DUT1 (BGP AS 10) redistributes RIP routes with metric 100 (MED) to DUT2 (BGP AS 20).

Scenario

Step 1: Set the following configuration in DUT0 :

set interfaces dummy dum0 address 192.168.100.1/24
set interfaces ethernet eth0 address 10.1.1.1/24
set protocols rip network 10.1.1.0/24
set protocols rip redistribute connected
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 ethernet eth0 address 10.1.1.100/24
set interfaces ethernet eth1 address 10.2.2.100/24
set protocols bgp 10 neighbor peer remote-address 10.2.2.2
set protocols bgp 10 neighbor peer remote-as 20
set protocols bgp 10 neighbor peer route-map export PERMIT
set protocols bgp 10 redistribute rip metric 100
set protocols rip network 10.1.1.0/24
set protocols rip timers update 5
set protocols route-map PERMIT rule 1 action permit
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 bgp 20 neighbor peer remote-address 10.2.2.100
set protocols bgp 20 neighbor peer remote-as 10
set protocols bgp 20 neighbor peer route-map import PERMIT
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify DUT1 learns the RIP route 192.168.100.0/24 from DUT0

Step 4: Run command protocols rip show at DUT1 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.1.1.0/24        0.0.0.0               1 self              0
R(n) 192.168.100.0/24   10.1.1.1              2 10.1.1.1          0 02:59

Attention

Verify BGP session is established between DUT1 and DUT2

Step 5: Run command protocols bgp show ip summary at DUT1 and check if output matches the following regular expressions:

10.2.2.2.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.2.2.100, local AS number 10 VRF default vrf-id 0
BGP table version 1
RIB entries 1, using 128 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
10.2.2.2        10.2.2.100      4         20         2         2        0    0    0 00:00:01  Established (Policy)        0 N/A

Total number of neighbors 1

Attention

Verify DUT2 learns route 192.168.100.0/24 with MED 100

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

[*]>\s+192.168.100.0/24.+\s100\s
Show output
BGP table version is 1, local router ID is 10.2.2.2, vrf id 0
Default local pref 100, local AS 20
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.100.0/24 10.2.2.100             100             0 10 ?

Displayed 1 routes and 1 total paths

Test BGP Redistribute RIP With Route-Map iBGP

Description

Test BGP redistribute rip route-map with iBGP. DUT0 announces two RIP routes (dum0 and dum1) via RIP. DUT1 uses a route-map to only redistribute 192.168.100.0/24 to BGP. 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 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 rip network 10.1.1.0/24
set protocols rip redistribute connected
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 ethernet eth0 address 10.1.1.100/24
set interfaces ethernet eth1 address 10.2.2.100/24
set protocols bgp 10 neighbor peer nexthop-self
set protocols bgp 10 neighbor peer remote-address 10.2.2.2
set protocols bgp 10 neighbor peer remote-as 10
set protocols bgp 10 redistribute rip route-map FILTER-RIP
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 rip network 10.1.1.0/24
set protocols rip timers update 5
set protocols route-map FILTER-RIP rule 1 action permit
set protocols route-map FILTER-RIP rule 1 match ip address prefix-list ALLOW-DUM0
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 bgp 10 neighbor peer remote-address 10.2.2.100
set protocols bgp 10 neighbor peer remote-as 10
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify DUT1 learns both RIP routes from DUT0

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

R\(n\) +192.168.100.0/24[\s\S]+R\(n\) +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
Sub-codes:
      (n) - normal, (s) - static, (d) - default, (r) - redistribute,
      (i) - interface

     Network            Next Hop         Metric From            Tag Time
C(i) 10.1.1.0/24        0.0.0.0               1 self              0
R(n) 192.168.100.0/24   10.1.1.1              2 10.1.1.1          0 02:59
R(n) 192.168.200.0/24   10.1.1.1              2 10.1.1.1          0 02:59

Attention

Verify BGP session is established between DUT1 and DUT2

Step 5: Run command protocols bgp show ip summary at DUT1 and check if output matches the following regular expressions:

10.2.2.2.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.2.2.100, local AS number 10 VRF default vrf-id 0
BGP table version 1
RIB entries 1, using 128 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
10.2.2.2        10.2.2.100      4         10         3         5        1    0    0 00:00:01  Established        0        1 FRRouting/10.4.1

Total number of neighbors 1

Attention

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

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

[*]>i\s+192.168.100.0/24
Show output
BGP table version is 1, local router ID is 10.2.2.2, vrf id 0
Default local pref 100, local AS 10
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 192.168.100.0/24 10.2.2.100               2    100      0 ?

Displayed 1 routes and 1 total paths

Test BGP Redistribute RIP With Route-Map eBGP

Description

Test BGP redistribute rip route-map with eBGP. DUT0 announces two RIP routes (dum0 and dum1) via RIP. DUT1 (BGP AS 10) uses a route-map to only redistribute 192.168.100.0/24 to BGP. DUT2 (BGP AS 20) learns only the matching route.

Scenario

Step 1: Set the following configuration in DUT0 :

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 rip network 10.1.1.0/24
set protocols rip redistribute connected
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 ethernet eth0 address 10.1.1.100/24
set interfaces ethernet eth1 address 10.2.2.100/24
set protocols bgp 10 neighbor peer remote-address 10.2.2.2
set protocols bgp 10 neighbor peer remote-as 20
set protocols bgp 10 neighbor peer route-map export PERMIT
set protocols bgp 10 redistribute rip route-map FILTER-RIP
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 rip network 10.1.1.0/24
set protocols rip timers update 5
set protocols route-map FILTER-RIP rule 1 action permit
set protocols route-map FILTER-RIP rule 1 match ip address prefix-list ALLOW-DUM0
set protocols route-map PERMIT rule 1 action permit
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 bgp 20 neighbor peer remote-address 10.2.2.100
set protocols bgp 20 neighbor peer remote-as 10
set protocols bgp 20 neighbor peer route-map import PERMIT
set protocols route-map PERMIT rule 1 action permit
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify DUT1 learns both RIP routes from DUT0

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

R\(n\) +192.168.100.0/24[\s\S]+R\(n\) +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
Sub-codes:
      (n) - normal, (s) - static, (d) - default, (r) - redistribute,
      (i) - interface

     Network            Next Hop         Metric From            Tag Time
C(i) 10.1.1.0/24        0.0.0.0               1 self              0
R(n) 192.168.100.0/24   10.1.1.1              2 10.1.1.1          0 02:59
R(n) 192.168.200.0/24   10.1.1.1              2 10.1.1.1          0 02:59

Attention

Verify BGP session is established between DUT1 and DUT2

Step 5: Run command protocols bgp show ip summary at DUT1 and check if output matches the following regular expressions:

10.2.2.2.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.2.2.100, local AS number 10 VRF default vrf-id 0
BGP table version 1
RIB entries 1, using 128 bytes of memory
Peers 1, using 24 KiB of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
10.2.2.2        10.2.2.100      4         20         2         2        0    0    0 00:00:00  Established (Policy)        0 N/A

Total number of neighbors 1

Attention

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

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

[*]>\s+192.168.100.0/24
Show output
BGP table version is 1, local router ID is 10.2.2.2, vrf id 0
Default local pref 100, local AS 20
local address -
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.100.0/24 10.2.2.100               2             0 10 ?

Displayed 1 routes and 1 total paths