Attribute-Unchanged

Scenario to verify BGP peer-group address-family ipv6-unicast attribute-unchanged inheritance. This command prevents the router from modifying specific BGP attributes when advertising IPv6 routes to neighbors that are members of the peer-group. 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.

../../../../../../_images/attribute-unchanged1.svg

Test eBGP IPv6 - Peer-group attribute-unchanged

Description

Test attribute-unchanged options (as-path, next-hop, med) on a peer-group under address-family ipv6-unicast. Baseline shows default re-advertisement behavior; each option preserves the corresponding attribute.

Scenario

Example 1

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '2001:db8:1::100/64'
set interfaces ethernet eth1 address '2001:db8:2::100/64'
set protocols bgp 100 neighbor dut1 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut1 address-family ipv6-unicast route-map import PERMIT
set protocols bgp 100 neighbor dut1 remote-address '2001:db8:1::200'
set protocols bgp 100 neighbor dut1 remote-as 200
set protocols bgp 100 neighbor dut2 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut2 peer-group MYGROUP
set protocols bgp 100 neighbor dut2 remote-address '2001:db8:2::200'
set protocols bgp 100 neighbor dut2 remote-as 300
set protocols bgp 100 parameters router-id 1.1.1.100
set protocols bgp 100 peer-group MYGROUP address-family ipv6-unicast 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 '2001:db8:10::1/64'
set interfaces ethernet eth0 address '2001:db8:1::200/64'
set protocols bgp 200 address-family ipv6-unicast redistribute connected route-map SET-MED
set protocols bgp 200 neighbor peer address-family ipv6-unicast activate
set protocols bgp 200 neighbor peer address-family ipv6-unicast route-map export SET-MED
set protocols bgp 200 neighbor peer remote-address '2001:db8:1::100'
set protocols bgp 200 neighbor peer remote-as 100
set protocols bgp 200 parameters router-id 1.1.1.200
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 '2001:db8:2::200/64'
set protocols bgp 300 neighbor peer address-family ipv6-unicast activate
set protocols bgp 300 neighbor peer address-family ipv6-unicast route-map import PERMIT
set protocols bgp 300 neighbor peer remote-address '2001:db8:2::100'
set protocols bgp 300 neighbor peer remote-as 100
set protocols bgp 300 parameters router-id 3.3.3.3
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 ipv6 summary at DUT0 and check if output matches the following regular expressions:

2001:db8:2::200.*Established[\s\S]*2001:db8:1::200.*Established
Show output
IPv6 Unicast Summary:
BGP router identifier 1.1.1.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
Peer groups 1, using 64 bytes of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
2001:db8:2::200 0.0.0.0         4        300         2         2        0    0    0 00:00:01  Established (Policy)        0 N/A
2001:db8:1::200 0.0.0.0         4        200         8         5        2    0    0 00:00:02  Established        2 (Policy) N/A

Total number of neighbors 2

Attention

Verify attribute behavior on DUT2.

Step 5: Run command protocols bgp show ipv6 2001:db8:10::/64 at DUT2 and check if output matches the following regular expressions:

100 200[\s\S]*2001:db8:2::100 from
Show output
BGP routing table entry for 2001:db8:10::/64, version 2
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  100 200
    2001:db8:2::100 from 2001:db8:2::100 (1.1.1.100)
    (fe80::dcad:beff:feef:6c01) (used)
      Origin incomplete, valid, external, best (First path received)
      Last update: Thu Mar  5 15:50:55 2026

Example 2

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '2001:db8:1::100/64'
set interfaces ethernet eth1 address '2001:db8:2::100/64'
set protocols bgp 100 neighbor dut1 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut1 address-family ipv6-unicast route-map import PERMIT
set protocols bgp 100 neighbor dut1 remote-address '2001:db8:1::200'
set protocols bgp 100 neighbor dut1 remote-as 200
set protocols bgp 100 neighbor dut2 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut2 peer-group MYGROUP
set protocols bgp 100 neighbor dut2 remote-address '2001:db8:2::200'
set protocols bgp 100 neighbor dut2 remote-as 300
set protocols bgp 100 parameters router-id 1.1.1.100
set protocols bgp 100 peer-group MYGROUP address-family ipv6-unicast attribute-unchanged as-path
set protocols bgp 100 peer-group MYGROUP address-family ipv6-unicast 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 '2001:db8:10::1/64'
set interfaces ethernet eth0 address '2001:db8:1::200/64'
set protocols bgp 200 address-family ipv6-unicast redistribute connected route-map SET-MED
set protocols bgp 200 neighbor peer address-family ipv6-unicast activate
set protocols bgp 200 neighbor peer address-family ipv6-unicast route-map export SET-MED
set protocols bgp 200 neighbor peer remote-address '2001:db8:1::100'
set protocols bgp 200 neighbor peer remote-as 100
set protocols bgp 200 parameters router-id 1.1.1.200
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 '2001:db8:2::200/64'
set protocols bgp 300 neighbor peer address-family ipv6-unicast activate
set protocols bgp 300 neighbor peer address-family ipv6-unicast route-map import PERMIT
set protocols bgp 300 neighbor peer remote-address '2001:db8:2::100'
set protocols bgp 300 neighbor peer remote-as 100
set protocols bgp 300 parameters router-id 3.3.3.3
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 ipv6 summary at DUT0 and check if output matches the following regular expressions:

2001:db8:2::200.*Established[\s\S]*2001:db8:1::200.*Established
Show output
IPv6 Unicast Summary:
BGP router identifier 1.1.1.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
Peer groups 1, using 64 bytes of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
2001:db8:2::200 0.0.0.0         4        300         4         4        0    0    0 00:00:01  Established (Policy)        0 N/A
2001:db8:1::200 0.0.0.0         4        200         6         6        2    0    0 00:00:03  Established        2 (Policy) N/A

Total number of neighbors 2

Attention

Verify attribute behavior on DUT0.

Step 5: Run command protocols bgp show ipv6 neighbors neighbor dut2 advertised-routes at DUT0 and check if output matches the following regular expressions:

2001:db8:10::/64[\s\S]*\s200\s
Show output
BGP table version is 2, local router ID is 1.1.1.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
 *>  2001:db8:1::/64  ::                                     0 200 ?
 *>  2001:db8:10::/64 ::                                     0 200 ?

Total number of prefixes 2

Example 3

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '2001:db8:1::100/64'
set interfaces ethernet eth1 address '2001:db8:2::100/64'
set protocols bgp 100 neighbor dut1 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut1 address-family ipv6-unicast route-map import PERMIT
set protocols bgp 100 neighbor dut1 remote-address '2001:db8:1::200'
set protocols bgp 100 neighbor dut1 remote-as 200
set protocols bgp 100 neighbor dut2 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut2 peer-group MYGROUP
set protocols bgp 100 neighbor dut2 remote-address '2001:db8:2::200'
set protocols bgp 100 neighbor dut2 remote-as 300
set protocols bgp 100 parameters router-id 1.1.1.100
set protocols bgp 100 peer-group MYGROUP address-family ipv6-unicast attribute-unchanged next-hop
set protocols bgp 100 peer-group MYGROUP address-family ipv6-unicast 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 '2001:db8:10::1/64'
set interfaces ethernet eth0 address '2001:db8:1::200/64'
set protocols bgp 200 address-family ipv6-unicast redistribute connected route-map SET-MED
set protocols bgp 200 neighbor peer address-family ipv6-unicast activate
set protocols bgp 200 neighbor peer address-family ipv6-unicast route-map export SET-MED
set protocols bgp 200 neighbor peer remote-address '2001:db8:1::100'
set protocols bgp 200 neighbor peer remote-as 100
set protocols bgp 200 parameters router-id 1.1.1.200
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 '2001:db8:2::200/64'
set protocols bgp 300 neighbor peer address-family ipv6-unicast activate
set protocols bgp 300 neighbor peer address-family ipv6-unicast route-map import PERMIT
set protocols bgp 300 neighbor peer remote-address '2001:db8:2::100'
set protocols bgp 300 neighbor peer remote-as 100
set protocols bgp 300 parameters router-id 3.3.3.3
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 ipv6 summary at DUT0 and check if output matches the following regular expressions:

2001:db8:2::200.*Established[\s\S]*2001:db8:1::200.*Established
Show output
IPv6 Unicast Summary:
BGP router identifier 1.1.1.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
Peer groups 1, using 64 bytes of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
2001:db8:2::200 0.0.0.0         4        300         4         5        2    0    0 00:00:02  Established (Policy)        2 N/A
2001:db8:1::200 0.0.0.0         4        200         8         5        2    0    0 00:00:04  Established        2 (Policy) N/A

Total number of neighbors 2

Attention

Verify attribute behavior on DUT2.

Step 5: Run command protocols bgp show ipv6 2001:db8:10::/64 at DUT2 and check if output matches the following regular expressions:

100 200[\s\S]*2001:db8:1::200 from 2001:db8:2::100
Show output
BGP routing table entry for 2001:db8:10::/64, version 2
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  100 200
    2001:db8:1::200 from 2001:db8:2::100 (1.1.1.100)
    (fe80::dcad:beff:feef:6c01) (used)
      Origin incomplete, valid, external, best (First path received)
      Last update: Thu Mar  5 15:51:21 2026

Example 4

Step 1: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address '2001:db8:1::100/64'
set interfaces ethernet eth1 address '2001:db8:2::100/64'
set protocols bgp 100 neighbor dut1 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut1 address-family ipv6-unicast route-map import PERMIT
set protocols bgp 100 neighbor dut1 remote-address '2001:db8:1::200'
set protocols bgp 100 neighbor dut1 remote-as 200
set protocols bgp 100 neighbor dut2 address-family ipv6-unicast activate
set protocols bgp 100 neighbor dut2 peer-group MYGROUP
set protocols bgp 100 neighbor dut2 remote-address '2001:db8:2::200'
set protocols bgp 100 neighbor dut2 remote-as 300
set protocols bgp 100 parameters router-id 1.1.1.100
set protocols bgp 100 peer-group MYGROUP address-family ipv6-unicast attribute-unchanged med
set protocols bgp 100 peer-group MYGROUP address-family ipv6-unicast 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 '2001:db8:10::1/64'
set interfaces ethernet eth0 address '2001:db8:1::200/64'
set protocols bgp 200 address-family ipv6-unicast redistribute connected route-map SET-MED
set protocols bgp 200 neighbor peer address-family ipv6-unicast activate
set protocols bgp 200 neighbor peer address-family ipv6-unicast route-map export SET-MED
set protocols bgp 200 neighbor peer remote-address '2001:db8:1::100'
set protocols bgp 200 neighbor peer remote-as 100
set protocols bgp 200 parameters router-id 1.1.1.200
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 '2001:db8:2::200/64'
set protocols bgp 300 neighbor peer address-family ipv6-unicast activate
set protocols bgp 300 neighbor peer address-family ipv6-unicast route-map import PERMIT
set protocols bgp 300 neighbor peer remote-address '2001:db8:2::100'
set protocols bgp 300 neighbor peer remote-as 100
set protocols bgp 300 parameters router-id 3.3.3.3
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 ipv6 summary at DUT0 and check if output matches the following regular expressions:

2001:db8:2::200.*Established[\s\S]*2001:db8:1::200.*Established
Show output
IPv6 Unicast Summary:
BGP router identifier 1.1.1.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
Peer groups 1, using 64 bytes of memory

Neighbor        LocalAddr       V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down        State   PfxRcd   PfxSnt Desc
2001:db8:2::200 0.0.0.0         4        300         4         3        0    0    0 00:00:01  Established (Policy)        0 N/A
2001:db8:1::200 0.0.0.0         4        200         7         7        2    0    0 00:00:02  Established        2 (Policy) N/A

Total number of neighbors 2

Attention

Verify attribute behavior on DUT2.

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

2001:db8:10::/64[\s\S]*50
Show output
BGP table version is 2, local router ID is 3.3.3.3, 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
 *>  2001:db8:1::/64  fe80::dcad:beff:feef:6c01
                                            50             0 100 200 ?
 *>  2001:db8:10::/64 fe80::dcad:beff:feef:6c01
                                            50             0 100 200 ?

Displayed 2 routes and 2 total paths