Traffic Params
This scenario demonstrates how to set some parameters like ToS or marks in BGP traffic.
Test Params In BGP Traffic
Description
In this scenario, a traffic policy was configured to drop unmarked traffic. In order to bypass this restriction, a new option has been configured in the BGP configuration to set the traffic mark/ToS.
Scenario
Example 1
Step 1: Clean all the configuration in DUT0
:
delete set system login user admin authentication encrypted-password $6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0
Step 2: Clean all the configuration in DUT1
:
delete set system login user admin authentication encrypted-password $6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0
Step 3: Clean all the configuration in DUT2
:
delete set system login user admin authentication encrypted-password $6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0
Step 4: Set the following configuration in DUT0
:
set interfaces ethernet eth0 address 192.168.100.20/24 set interfaces ethernet eth0 traffic policy out ACCEPT_MARKED set interfaces dummy dum0 address 1.1.1.1/24 set protocols route-map PERMIT rule 1 action permit set protocols bgp 20 redistribute connected route-map PERMIT set protocols bgp 20 peer-group overlay remote-as 20 set protocols bgp 20 peer-group overlay listen range 192.168.100.0/24 set traffic policy ACCEPT_MARKED rule 1 action accept set traffic policy ACCEPT_MARKED rule 1 selector SEL_MARKED set traffic policy ACCEPT_MARKED rule 2 action drop set protocols bgp 20 parameters mark 10 set traffic selector SEL_MARKED rule 1 mark 10
Step 5: Set the following configuration in DUT1
:
set interfaces ethernet eth0 address 192.168.100.10/24 set protocols bgp 20 neighbor peer remote-address 192.168.100.20 set protocols bgp 20 neighbor peer remote-as 20
Step 6: Run command protocols bgp show ip summary
at DUT1
and check if output matches the following regular expressions:
192.168.100.20
Show output
IPv4 Unicast Summary (VRF default): BGP router identifier 192.168.100.10, local AS number 20 vrf-id 0 BGP table version 0 RIB entries 0, using 0 bytes of memory Peers 1, using 725 KiB of memory Neighbor LocalAddr V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State PfxRcd PfxSnt Desc 192.168.100.20 - 4 20 0 0 0 0 0 never Idle 0 0 N/A Total number of neighbors 1
Step 7: Run command protocols bgp show ip
at DUT1
and check if output matches the following regular expressions:
1.1.1.0/24Show output
BGP table version is 2, local router ID is 192.168.100.10, vrf id 0 Default local pref 100, local AS 20 local address - Status codes: s suppressed, d damped, h history, * 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 *>i1.1.1.0/24 192.168.100.20 0 100 0 ? *>i192.168.100.0/24 192.168.100.20 0 100 0 ? Displayed 2 routes and 2 total paths
Example 2
Step 1: Clean all the configuration in DUT0
:
delete set system login user admin authentication encrypted-password $6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0
Step 2: Clean all the configuration in DUT1
:
delete set system login user admin authentication encrypted-password $6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0
Step 3: Clean all the configuration in DUT2
:
delete set system login user admin authentication encrypted-password $6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0
Step 4: Set the following configuration in DUT0
:
set interfaces ethernet eth0 address 192.168.100.20/24 set interfaces ethernet eth0 traffic policy out ACCEPT_MARKED set interfaces dummy dum0 address 1.1.1.1/24 set protocols route-map PERMIT rule 1 action permit set protocols bgp 20 redistribute connected route-map PERMIT set protocols bgp 20 peer-group overlay remote-as 20 set protocols bgp 20 peer-group overlay listen range 192.168.100.0/24 set traffic policy ACCEPT_MARKED rule 1 action accept set traffic policy ACCEPT_MARKED rule 1 selector SEL_MARKED set traffic policy ACCEPT_MARKED rule 2 action drop set protocols bgp 20 parameters tos 32 set traffic selector SEL_MARKED rule 1 dscp 8
Step 5: Set the following configuration in DUT1
:
set interfaces ethernet eth0 address 192.168.100.10/24 set protocols bgp 20 neighbor peer remote-address 192.168.100.20 set protocols bgp 20 neighbor peer remote-as 20
Step 6: Run command protocols bgp show ip summary
at DUT1
and check if output matches the following regular expressions:
192.168.100.20
Show output
IPv4 Unicast Summary (VRF default): BGP router identifier 192.168.100.10, local AS number 20 vrf-id 0 BGP table version 0 RIB entries 0, using 0 bytes of memory Peers 1, using 725 KiB of memory Neighbor LocalAddr V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State PfxRcd PfxSnt Desc 192.168.100.20 - 4 20 0 0 0 0 0 never Idle 0 0 N/A Total number of neighbors 1
Step 7: Run command protocols bgp show ip
at DUT1
and check if output matches the following regular expressions:
1.1.1.0/24Show output
BGP table version is 2, local router ID is 192.168.100.10, vrf id 0 Default local pref 100, local AS 20 local address - Status codes: s suppressed, d damped, h history, * 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 *>i1.1.1.0/24 192.168.100.20 0 100 0 ? *>i192.168.100.0/24 192.168.100.20 0 100 0 ? Displayed 2 routes and 2 total paths