Attribute-Unchanged
Test BGP attribute-unchanged functionality. This command prevents the router from modifying specific BGP attributes when advertising routes to a neighbor. By default, when advertising to an eBGP peer, the router changes the next-hop to its own address, prepends its AS number to the AS-path, and may modify the MED value. The attribute-unchanged command allows preserving these attributes in their original form. The as-path option prevents the router from prepending its local AS to the path. The med option preserves the Multi-Exit Discriminator value without modification. The next-hop option keeps the original next-hop address instead of replacing it with the advertising router’s address. This feature is typically used with eBGP multihop peers in scenarios like MPLS inter-AS.
Test eBGP - Default behavior modifies attributes on re-advertisement
Description
Baseline test showing default eBGP re-advertisement behavior. DUT1 (AS 200) originates 1.1.1.0/24. DUT0 (AS 100) receives and forwards to DUT2 (AS 300) without attribute-unchanged. DUT2 should see next-hop changed to DUT0’s IP and AS-path prepended with AS 100.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.10.0.100/24 set interfaces ethernet eth1 address 20.20.0.100/24 set protocols bgp 100 neighbor dut1 remote-address 10.10.0.200 set protocols bgp 100 neighbor dut1 remote-as 200 set protocols bgp 100 neighbor dut1 route-map import PERMIT set protocols bgp 100 neighbor dut2 remote-address 20.20.0.200 set protocols bgp 100 neighbor dut2 remote-as 300 set protocols bgp 100 neighbor dut2 route-map export PERMIT set protocols route-map PERMIT rule 1 action permit 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 1.1.1.1/24 set interfaces ethernet eth0 address 10.10.0.200/24 set protocols bgp 200 neighbor peer remote-address 10.10.0.100 set protocols bgp 200 neighbor peer remote-as 100 set protocols bgp 200 neighbor peer route-map export SET-MED set protocols bgp 200 redistribute connected route-map SET-MED set protocols route-map SET-MED rule 1 action permit set protocols route-map SET-MED rule 1 set metric 50 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Set the following configuration in DUT2 :
set interfaces ethernet eth0 address 20.20.0.200/24 set protocols bgp 300 neighbor peer remote-address 20.20.0.100 set protocols bgp 300 neighbor peer remote-as 100 set protocols bgp 300 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 eBGP sessions establish on DUT0.
Step 4: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:
10.10.0.200.*Established[\s\S]*20.20.0.200.*EstablishedShow output
IPv4 Unicast Summary: BGP router identifier 20.20.0.100, local AS number 100 VRF default vrf-id 0 BGP table version 2 RIB entries 3, using 384 bytes of memory Peers 2, using 47 KiB of memory Neighbor LocalAddr V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State PfxRcd PfxSnt Desc 10.10.0.200 10.10.0.100 4 200 5 3 2 0 0 00:00:02 Established 2 (Policy) N/A 20.20.0.200 20.20.0.100 4 300 2 4 0 0 0 00:00:00 Established (Policy) 0 N/A Total number of neighbors 2
Attention
Verify DUT2 receives route 1.1.1.0/24 with next-hop as DUT0’s IP and AS-path 100 200.
Step 5: Run command protocols bgp show ip 1.1.1.0/24 at DUT2 and check if output matches the following regular expressions:
100 200[\s\S]*20.20.0.100 from 20.20.0.100Show output
BGP routing table entry for 1.1.1.0/24, version 1 Paths: (1 available, best #1, table default) Not advertised to any peer 100 200 20.20.0.100 from 20.20.0.100 (20.20.0.100) Origin incomplete, valid, external, best (First path received) Last update: Thu Mar 5 14:36:15 2026
Test eBGP - Attribute-unchanged as-path
Description
Verify that attribute-unchanged as-path prevents DUT0 from prepending its AS when re-advertising routes. DUT0 forwards to DUT2 without adding AS 100 to the path.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.10.0.100/24 set interfaces ethernet eth1 address 20.20.0.100/24 set protocols bgp 100 neighbor dut1 remote-address 10.10.0.200 set protocols bgp 100 neighbor dut1 remote-as 200 set protocols bgp 100 neighbor dut1 route-map import PERMIT set protocols bgp 100 neighbor dut2 attribute-unchanged as-path set protocols bgp 100 neighbor dut2 remote-address 20.20.0.200 set protocols bgp 100 neighbor dut2 remote-as 300 set protocols bgp 100 neighbor dut2 route-map export PERMIT set protocols route-map PERMIT rule 1 action permit 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 1.1.1.1/24 set interfaces ethernet eth0 address 10.10.0.200/24 set protocols bgp 200 neighbor peer remote-address 10.10.0.100 set protocols bgp 200 neighbor peer remote-as 100 set protocols bgp 200 neighbor peer route-map export SET-MED set protocols bgp 200 redistribute connected route-map SET-MED set protocols route-map SET-MED rule 1 action permit set protocols route-map SET-MED rule 1 set metric 50 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Set the following configuration in DUT2 :
set interfaces ethernet eth0 address 20.20.0.200/24 set protocols bgp 300 neighbor peer remote-address 20.20.0.100 set protocols bgp 300 neighbor peer remote-as 100 set protocols bgp 300 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 eBGP sessions establish on DUT0.
Step 4: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:
10.10.0.200.*Established[\s\S]*20.20.0.200.*EstablishedShow output
IPv4 Unicast Summary: BGP router identifier 20.20.0.100, local AS number 100 VRF default vrf-id 0 BGP table version 2 RIB entries 3, using 384 bytes of memory Peers 2, using 47 KiB of memory Neighbor LocalAddr V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State PfxRcd PfxSnt Desc 10.10.0.200 10.10.0.100 4 200 5 3 2 0 0 00:00:01 Established 2 (Policy) N/A 20.20.0.200 20.20.0.100 4 300 2 2 0 0 0 00:00:00 Established (Policy) 0 N/A Total number of neighbors 2
Attention
Verify DUT0 advertises route 1.1.1.0/24 to DUT2 with AS-path 200 (not prepended).
Step 5: Run command protocols bgp show ip neighbors neighbor dut2 advertised-routes at DUT0 and check if output matches the following regular expressions:
1.1.1.0/24[\s\S]*\s200\sShow output
BGP table version is 2, local router ID is 20.20.0.100, vrf id 0 Default local pref 100, local AS 100 local address (null) 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 *u 1.1.1.0/24 0.0.0.0 0 200 ? *u 10.10.0.0/24 0.0.0.0 0 200 ? Total number of prefixes 2
Test eBGP - Attribute-unchanged next-hop
Description
Verify that attribute-unchanged next-hop preserves the original next-hop when re-advertising routes. DUT0 forwards to DUT2 keeping DUT1’s IP as next-hop, but AS-path is still prepended with DUT0’s AS.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.10.0.100/24 set interfaces ethernet eth1 address 20.20.0.100/24 set protocols bgp 100 neighbor dut1 remote-address 10.10.0.200 set protocols bgp 100 neighbor dut1 remote-as 200 set protocols bgp 100 neighbor dut1 route-map import PERMIT set protocols bgp 100 neighbor dut2 attribute-unchanged next-hop set protocols bgp 100 neighbor dut2 remote-address 20.20.0.200 set protocols bgp 100 neighbor dut2 remote-as 300 set protocols bgp 100 neighbor dut2 route-map export PERMIT set protocols route-map PERMIT rule 1 action permit 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 1.1.1.1/24 set interfaces ethernet eth0 address 10.10.0.200/24 set protocols bgp 200 neighbor peer remote-address 10.10.0.100 set protocols bgp 200 neighbor peer remote-as 100 set protocols bgp 200 neighbor peer route-map export SET-MED set protocols bgp 200 redistribute connected route-map SET-MED set protocols route-map SET-MED rule 1 action permit set protocols route-map SET-MED rule 1 set metric 50 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Set the following configuration in DUT2 :
set interfaces ethernet eth0 address 20.20.0.200/24 set protocols bgp 300 neighbor peer remote-address 20.20.0.100 set protocols bgp 300 neighbor peer remote-as 100 set protocols bgp 300 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 eBGP sessions establish on DUT0.
Step 4: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:
10.10.0.200.*Established[\s\S]*20.20.0.200.*EstablishedShow output
IPv4 Unicast Summary: BGP router identifier 20.20.0.100, local AS number 100 VRF default vrf-id 0 BGP table version 2 RIB entries 3, using 384 bytes of memory Peers 2, using 47 KiB of memory Neighbor LocalAddr V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State PfxRcd PfxSnt Desc 10.10.0.200 10.10.0.100 4 200 5 3 2 0 0 00:00:02 Established 2 (Policy) N/A 20.20.0.200 20.20.0.100 4 300 2 2 0 0 0 00:00:00 Established (Policy) 0 N/A Total number of neighbors 2
Attention
Verify DUT2 receives route 1.1.1.0/24 with original next-hop preserved (inaccessible from DUT2).
Step 5: Run command protocols bgp show ip 1.1.1.0/24 at DUT2 and check if output matches the following regular expressions:
10.10.0.200 \(inaccessibleShow output
BGP routing table entry for 1.1.1.0/24, version 0 Paths: (1 available, no best path) Not advertised to any peer 100 200 10.10.0.200 (inaccessible, import-check enabled) from 20.20.0.100 (20.20.0.100) Origin incomplete, invalid, external Last update: Thu Mar 5 14:36:42 2026
Attention
Verify DUT2 still sees AS-path 100 200 (only next-hop is unchanged).
Step 6: Run command protocols bgp show ip 1.1.1.0/24 at DUT2 and check if output matches the following regular expressions:
100 200Show output
BGP routing table entry for 1.1.1.0/24, version 0 Paths: (1 available, no best path) Not advertised to any peer 100 200 10.10.0.200 (inaccessible, import-check enabled) from 20.20.0.100 (20.20.0.100) Origin incomplete, invalid, external Last update: Thu Mar 5 14:36:42 2026
Test eBGP - Attribute-unchanged med
Description
Verify that attribute-unchanged med preserves the MED value when re-advertising routes. DUT1 sets MED 50 and DUT2 should see it unchanged.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.10.0.100/24 set interfaces ethernet eth1 address 20.20.0.100/24 set protocols bgp 100 neighbor dut1 remote-address 10.10.0.200 set protocols bgp 100 neighbor dut1 remote-as 200 set protocols bgp 100 neighbor dut1 route-map import PERMIT set protocols bgp 100 neighbor dut2 attribute-unchanged med set protocols bgp 100 neighbor dut2 remote-address 20.20.0.200 set protocols bgp 100 neighbor dut2 remote-as 300 set protocols bgp 100 neighbor dut2 route-map export PERMIT set protocols route-map PERMIT rule 1 action permit 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 1.1.1.1/24 set interfaces ethernet eth0 address 10.10.0.200/24 set protocols bgp 200 neighbor peer remote-address 10.10.0.100 set protocols bgp 200 neighbor peer remote-as 100 set protocols bgp 200 neighbor peer route-map export SET-MED set protocols bgp 200 redistribute connected route-map SET-MED set protocols route-map SET-MED rule 1 action permit set protocols route-map SET-MED rule 1 set metric 50 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Set the following configuration in DUT2 :
set interfaces ethernet eth0 address 20.20.0.200/24 set protocols bgp 300 neighbor peer remote-address 20.20.0.100 set protocols bgp 300 neighbor peer remote-as 100 set protocols bgp 300 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 eBGP sessions establish on DUT0.
Step 4: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:
10.10.0.200.*Established[\s\S]*20.20.0.200.*EstablishedShow output
IPv4 Unicast Summary: BGP router identifier 20.20.0.100, local AS number 100 VRF default vrf-id 0 BGP table version 2 RIB entries 3, using 384 bytes of memory Peers 2, using 47 KiB of memory Neighbor LocalAddr V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State PfxRcd PfxSnt Desc 10.10.0.200 10.10.0.100 4 200 5 3 2 0 0 00:00:02 Established 2 (Policy) N/A 20.20.0.200 20.20.0.100 4 300 3 4 0 0 0 00:00:00 Established (Policy) 0 N/A Total number of neighbors 2
Attention
Verify DUT2 receives route 1.1.1.0/24 with MED 50 preserved.
Step 5: Run command protocols bgp show ip at DUT2 and check if output matches the following regular expressions:
1.1.1.0/24\s+20.20.0.100\s+50Show output
BGP table version is 2, local router ID is 20.20.0.200, vrf id 0 Default local pref 100, local AS 300 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 *> 1.1.1.0/24 20.20.0.100 50 0 100 200 ? *> 10.10.0.0/24 20.20.0.100 50 0 100 200 ? Displayed 2 routes and 2 total paths