Network

Scenario to verify BGP network command functionality, including basic network advertisement and route-map filtered advertisement, for both iBGP and eBGP sessions.

The network command is the primary method for injecting routes into BGP. It tells the router to advertise a specific prefix to BGP neighbors, provided the route exists in the routing table (e.g., via a static blackhole route).

  • Basic network: Announces the specified prefix to all neighbors. DUT1 should learn the network and install it in its routing table.

  • Network with route-map: Applies a route-map filter to the network command. Only networks matching the route-map criteria (via prefix-list) are announced. In this test, three networks are configured but only one matches the filter, so DUT1 learns only that network while the others are filtered out.

Each variant is tested with both iBGP (same AS) and eBGP (different AS) sessions.

Test BGP Network

Description

Test BGP network command: basic (DUT1 learns the announced network) and route-map (only matching networks are advertised, others filtered out). Each variant tested with iBGP and eBGP.

Scenario

Example 1

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.1.1.1/24
set protocols bgp 10 neighbor peer nexthop-self
set protocols bgp 10 neighbor peer remote-address 10.1.1.2
set protocols bgp 10 neighbor peer remote-as 10
set protocols bgp 10 network 192.168.10.0/24
set protocols static route 192.168.10.0/24 blackhole
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.2/24
set protocols bgp 10 neighbor peer remote-address 10.1.1.1
set protocols bgp 10 neighbor peer remote-as 10
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify BGP session is established between DUT0 and DUT1.

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

10.1.1.2.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.1.1.1, 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.1.1.2        10.1.1.1        4         10         3         5        1    0    0 00:00:02  Established        0        1 FRRouting/10.4.1

Total number of neighbors 1

Attention

Verify DUT1 learns network 192.168.10.0/24.

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

[*]>i\s+192.168.10.0/24
Show output
BGP table version is 1, local router ID is 10.1.1.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.10.0/24  10.1.1.1                 0    100      0 i

Displayed 1 routes and 1 total paths

Attention

Verify that route is installed in DUT1 routing table.

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

B>[*]\s+192.168.10.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.1.1.0/24 is directly connected, eth0, weight 1, 00:00:03
K * 10.1.1.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:03
L>* 10.1.1.2/32 is directly connected, eth0, weight 1, 00:00:03
B>* 192.168.10.0/24 [200/0] via 10.1.1.1, eth0, weight 1, 00:00:01

Example 2

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.1.1.1/24
set protocols bgp 10 neighbor peer remote-address 10.1.1.2
set protocols bgp 10 neighbor peer remote-as 20
set protocols bgp 10 neighbor peer route-map export PERMIT
set protocols bgp 10 network 192.168.10.0/24
set protocols route-map PERMIT rule 1 action permit
set protocols static route 192.168.10.0/24 blackhole
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.2/24
set protocols bgp 20 neighbor peer remote-address 10.1.1.1
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 BGP session is established between DUT0 and DUT1.

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

10.1.1.2.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.1.1.1, 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.1.1.2        10.1.1.1        4         20         2         4        0    0    0 00:00:00  Established (Policy)        0 N/A

Total number of neighbors 1

Attention

Verify DUT1 learns network 192.168.10.0/24.

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

[*]>\s+192.168.10.0/24
Show output
BGP table version is 1, local router ID is 10.1.1.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.10.0/24  10.1.1.1                 0             0 10 i

Displayed 1 routes and 1 total paths

Attention

Verify that route is installed in DUT1 routing table.

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

B>[*]\s+192.168.10.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.1.1.0/24 is directly connected, eth0, weight 1, 00:00:03
K * 10.1.1.0/24 [0/0] is directly connected, eth0, weight 1, 00:00:03
L>* 10.1.1.2/32 is directly connected, eth0, weight 1, 00:00:03
B>* 192.168.10.0/24 [20/0] via 10.1.1.1, eth0, weight 1, 00:00:02

Example 3

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.1.1.1/24
set protocols bgp 10 neighbor peer nexthop-self
set protocols bgp 10 neighbor peer remote-address 10.1.1.2
set protocols bgp 10 neighbor peer remote-as 10
set protocols bgp 10 network 192.168.10.0/24 route-map FILTER-NET
set protocols bgp 10 network 192.168.20.0/24 route-map FILTER-NET
set protocols bgp 10 network 192.168.30.0/24 route-map FILTER-NET
set protocols ip prefix-list ALLOW-NET1 rule 1 action permit
set protocols ip prefix-list ALLOW-NET1 rule 1 prefix 192.168.10.0/24
set protocols route-map FILTER-NET rule 1 action permit
set protocols route-map FILTER-NET rule 1 match ip address prefix-list ALLOW-NET1
set protocols static route 192.168.10.0/24 blackhole
set protocols static route 192.168.20.0/24 blackhole
set protocols static route 192.168.30.0/24 blackhole
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.2/24
set protocols bgp 10 neighbor peer remote-address 10.1.1.1
set protocols bgp 10 neighbor peer remote-as 10
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Attention

Verify BGP session is established between DUT0 and DUT1.

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

10.1.1.2.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.1.1.1, 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.1.1.2        10.1.1.1        4         10         3         4        1    0    0 00:00:01  Established        0        1 FRRouting/10.4.1

Total number of neighbors 1

Attention

Verify DUT1 learns network 192.168.10.0/24.

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

[*]>i\s+192.168.10.0/24
Show output
BGP table version is 1, local router ID is 10.1.1.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.10.0/24  10.1.1.1                 0    100      0 i

Displayed 1 routes and 1 total paths

Example 4

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.1.1.1/24
set protocols bgp 10 neighbor peer remote-address 10.1.1.2
set protocols bgp 10 neighbor peer remote-as 20
set protocols bgp 10 neighbor peer route-map export PERMIT
set protocols bgp 10 network 192.168.10.0/24 route-map FILTER-NET
set protocols bgp 10 network 192.168.20.0/24 route-map FILTER-NET
set protocols bgp 10 network 192.168.30.0/24 route-map FILTER-NET
set protocols ip prefix-list ALLOW-NET1 rule 1 action permit
set protocols ip prefix-list ALLOW-NET1 rule 1 prefix 192.168.10.0/24
set protocols route-map FILTER-NET rule 1 action permit
set protocols route-map FILTER-NET rule 1 match ip address prefix-list ALLOW-NET1
set protocols route-map PERMIT rule 1 action permit
set protocols static route 192.168.10.0/24 blackhole
set protocols static route 192.168.20.0/24 blackhole
set protocols static route 192.168.30.0/24 blackhole
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.2/24
set protocols bgp 20 neighbor peer remote-address 10.1.1.1
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 BGP session is established between DUT0 and DUT1.

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

10.1.1.2.*Established
Show output
IPv4 Unicast Summary:
BGP router identifier 10.1.1.1, 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.1.1.2        10.1.1.1        4         20         2         4        0    0    0 00:00:00  Established (Policy)        0 N/A

Total number of neighbors 1

Attention

Verify DUT1 learns network 192.168.10.0/24.

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

[*]>\s+192.168.10.0/24
Show output
BGP table version is 1, local router ID is 10.1.1.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.10.0/24  10.1.1.1                 0             0 10 i

Displayed 1 routes and 1 total paths