Addpath
Scenario to verify BGP peer-group addpath inheritance.
By default, BGP only advertises the single best path for each prefix to its neighbors.
The addpath feature allows the router to advertise multiple paths, giving the receiving
peer visibility of alternative routes for its own path selection. The
addpath-tx-all-paths option advertises all available paths for a prefix to the
neighbor. The addpath-tx-bestpath-per-AS option provides a middle ground by
advertising only the best path from each originating AS. When configured on a
peer-group, all members of the group inherit the addpath behavior.
Test eBGP - Peer-group addpath modes
Description
Test addpath modes on a peer-group: without addpath (baseline, 1 path),
with addpath-tx-all-paths (2 paths), and with addpath-tx-bestpath-per-AS (2 paths).
Scenario
Example 1
Step 1: Set the following configuration in DUT0 :
set interfaces dummy dum0 address 1.1.1.1/24 set interfaces ethernet eth0 address 10.0.0.1/24 set interfaces ethernet eth1 address 10.0.1.1/24 set protocols bgp 100 neighbor receiver peer-group RECEIVERS set protocols bgp 100 neighbor receiver remote-address 10.0.1.2 set protocols bgp 100 neighbor sender remote-address 10.0.0.2 set protocols bgp 100 neighbor sender remote-as 200 set protocols bgp 100 neighbor sender route-map import PERMIT set protocols bgp 100 peer-group RECEIVERS remote-as 300 set protocols bgp 100 peer-group RECEIVERS route-map export PERMIT set protocols bgp 100 redistribute connected 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.0.0.2/24 set protocols bgp 200 neighbor peer remote-address 10.0.0.1 set protocols bgp 200 neighbor peer remote-as 100 set protocols bgp 200 neighbor peer route-map export PERMIT set protocols bgp 200 redistribute connected 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 eth0 address 10.0.1.2/24 set protocols bgp 300 neighbor peer remote-address 10.0.1.1 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.
Step 4: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:
10.0.1.2.*Established[\s\S]*10.0.0.2.*EstablishedShow output
IPv4 Unicast Summary: BGP router identifier 10.0.1.1, local AS number 100 VRF default vrf-id 0 BGP table version 3 RIB entries 5, using 640 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 10.0.1.2 10.0.1.1 4 300 3 4 0 0 0 00:00:00 Established (Policy) 0 N/A 10.0.0.2 10.0.0.1 4 200 5 3 3 0 0 00:00:01 Established 2 (Policy) N/A Total number of neighbors 2
Attention
Verify DUT2 receives 1 path(s) for 1.1.1.0/24.
Step 5: Run command protocols bgp show ip 1.1.1.0/24 at DUT2 and check if output matches the following regular expressions:
Paths:.*1 availableShow 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 10.0.1.1 from 10.0.1.1 (10.0.1.1) Origin incomplete, metric 0, valid, external, best (First path received) Last update: Thu Mar 5 15:45:44 2026
Example 2
Step 1: Set the following configuration in DUT0 :
set interfaces dummy dum0 address 1.1.1.1/24 set interfaces ethernet eth0 address 10.0.0.1/24 set interfaces ethernet eth1 address 10.0.1.1/24 set protocols bgp 100 neighbor receiver peer-group RECEIVERS set protocols bgp 100 neighbor receiver remote-address 10.0.1.2 set protocols bgp 100 neighbor sender remote-address 10.0.0.2 set protocols bgp 100 neighbor sender remote-as 200 set protocols bgp 100 neighbor sender route-map import PERMIT set protocols bgp 100 peer-group RECEIVERS addpath-tx-all-paths set protocols bgp 100 peer-group RECEIVERS remote-as 300 set protocols bgp 100 peer-group RECEIVERS route-map export PERMIT set protocols bgp 100 redistribute connected 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.0.0.2/24 set protocols bgp 200 neighbor peer remote-address 10.0.0.1 set protocols bgp 200 neighbor peer remote-as 100 set protocols bgp 200 neighbor peer route-map export PERMIT set protocols bgp 200 redistribute connected 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 eth0 address 10.0.1.2/24 set protocols bgp 300 neighbor peer remote-address 10.0.1.1 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.
Step 4: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:
10.0.1.2.*Established[\s\S]*10.0.0.2.*EstablishedShow output
IPv4 Unicast Summary: BGP router identifier 10.0.1.1, local AS number 100 VRF default vrf-id 0 BGP table version 5 RIB entries 5, using 640 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 10.0.1.2 10.0.1.1 4 300 2 4 0 0 0 00:00:00 Established (Policy) 0 N/A 10.0.0.2 10.0.0.1 4 200 5 3 5 0 0 00:00:02 Established 2 (Policy) N/A Total number of neighbors 2
Attention
Verify DUT2 receives 2 path(s) for 1.1.1.0/24.
Step 5: Run command protocols bgp show ip 1.1.1.0/24 at DUT2 and check if output matches the following regular expressions:
Paths:.*2 availableShow output
BGP routing table entry for 1.1.1.0/24, version 1 Paths: (2 available, best #1, table default) Not advertised to any peer 100 10.0.1.1 from 10.0.1.1 (10.0.1.1) Origin incomplete, metric 0, valid, external, best (AS Path) AddPath ID: RX 2, TX-All 0 TX-Best-Per-AS 0 TX-Best-Selected 0 Last update: Thu Mar 5 15:45:55 2026 100 200 10.0.1.1 from 10.0.1.1 (10.0.1.1) Origin incomplete, valid, external AddPath ID: RX 5, TX-All 0 TX-Best-Per-AS 0 TX-Best-Selected 0 Last update: Thu Mar 5 15:45:55 2026
Attention
Verify addpath TX is advertised on the neighbor.
Step 6: Run command protocols bgp show ip neighbors neighbor receiver at DUT0 and check if output matches the following regular expressions:
IPv4 Unicast: TX advertisedShow output
BGP neighbor is 10.0.1.2, remote AS 300, local AS 100, external link Local Role: undefined Remote Role: undefined Hostname: osdx Member of peer-group RECEIVERS for session parameters BGP version 4, remote router ID 10.0.1.2, local router ID 10.0.1.1 BGP state = Established, up for 00:00:02 Last read 00:00:01, Last write 00:00:01 Hold time is 90 seconds, keepalive interval is 30 seconds Configured hold time is 90 seconds, keepalive interval is 30 seconds Configured tcp-mss is 0, synced tcp-mss is 1448 Configured conditional advertisements interval is 60 seconds Neighbor capabilities: 4 Byte AS: advertised and received AddPath: IPv4 Unicast: TX advertised IPv4 Unicast: RX advertised and received Paths-Limit: IPv4 Unicast: advertised (0) and received (0) Long-lived Graceful Restart: advertised and received Address families by peer: Route refresh: advertised and received Enhanced Route Refresh: advertised and received Address Family IPv4 Unicast: advertised and received Hostname Capability: advertised (name: osdx,domain name: n/a) received (name: osdx,domain name: n/a) Version Capability: not advertised not received Link-Local Next Hop Capability: not advertised not received Graceful Restart Capability: advertised and received Remote Restart timer is 120 seconds Address families by peer: none Graceful restart information: End-of-RIB send: IPv4 Unicast End-of-RIB received: IPv4 Unicast Local GR Mode: Helper* Remote GR Mode: Helper R bit: True N bit: True Timers: Configured Restart Time(sec): 120 Received Restart Time(sec): 120 Configured LLGR Stale Path Time(sec): 0 IPv4 Unicast: F bit: False End-of-RIB sent: Yes End-of-RIB sent after update: Yes End-of-RIB received: Yes Timers: Configured Stale Path Time(sec): 360 LLGR Stale Path Time(sec): 0 Message statistics: Inq depth is 0 Outq depth is 0 Sent Rcvd Opens: 2 1 Notifications: 1 0 Updates: 9 1 Keepalives: 1 1 Route Refresh: 2 1 Capability: 0 0 Total: 15 4 Prefix statistics: Inbound filtered: 0 AS-PATH loop: 0 Originator loop: 0 Cluster loop: 0 Invalid next-hop: 0 Withdrawn: 0 Attributes discarded: 0 Minimum time between advertisement runs is 0 seconds For address family: IPv4 Unicast RECEIVERS peer-group member Update group 2, subgroup 2 Packet Queue length 0 Advertise all paths via addpath Community attribute sent to this neighbor(all) Outbound path policy configured Route map for outgoing advertisements is *PERMIT Inbound updates discarded due to missing policy 0 accepted, 5 sent prefixes Connections established 1; dropped 0 Last reset never External BGP neighbor may be up to 1 hops away. Local host: 10.0.1.1, Local port: 179 Foreign host: 10.0.1.2, Foreign port: 44638 Nexthop: 10.0.1.1 Nexthop global: fe80::dcad:beff:feef:6c01 Nexthop local: fe80::dcad:beff:feef:6c01 BGP connection: shared network BGP Connect Retry Timer in Seconds: 30 Estimated round trip time: 0 ms Read thread: on Write thread: on FD used: 27
Example 3
Step 1: Set the following configuration in DUT0 :
set interfaces dummy dum0 address 1.1.1.1/24 set interfaces ethernet eth0 address 10.0.0.1/24 set interfaces ethernet eth1 address 10.0.1.1/24 set protocols bgp 100 neighbor receiver peer-group RECEIVERS set protocols bgp 100 neighbor receiver remote-address 10.0.1.2 set protocols bgp 100 neighbor sender remote-address 10.0.0.2 set protocols bgp 100 neighbor sender remote-as 200 set protocols bgp 100 neighbor sender route-map import PERMIT set protocols bgp 100 peer-group RECEIVERS addpath-tx-bestpath-per-AS set protocols bgp 100 peer-group RECEIVERS remote-as 300 set protocols bgp 100 peer-group RECEIVERS route-map export PERMIT set protocols bgp 100 redistribute connected 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.0.0.2/24 set protocols bgp 200 neighbor peer remote-address 10.0.0.1 set protocols bgp 200 neighbor peer remote-as 100 set protocols bgp 200 neighbor peer route-map export PERMIT set protocols bgp 200 redistribute connected 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 eth0 address 10.0.1.2/24 set protocols bgp 300 neighbor peer remote-address 10.0.1.1 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.
Step 4: Run command protocols bgp show ip summary at DUT0 and check if output matches the following regular expressions:
10.0.1.2.*Established[\s\S]*10.0.0.2.*EstablishedShow output
IPv4 Unicast Summary: BGP router identifier 10.0.1.1, local AS number 100 VRF default vrf-id 0 BGP table version 5 RIB entries 5, using 640 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 10.0.1.2 10.0.1.1 4 300 3 4 0 0 0 00:00:00 Established (Policy) 0 N/A 10.0.0.2 10.0.0.1 4 200 5 3 5 0 0 00:00:02 Established 2 (Policy) N/A Total number of neighbors 2
Attention
Verify DUT2 receives 2 path(s) for 1.1.1.0/24.
Step 5: Run command protocols bgp show ip 1.1.1.0/24 at DUT2 and check if output matches the following regular expressions:
Paths:.*2 availableShow output
BGP routing table entry for 1.1.1.0/24, version 1 Paths: (2 available, best #1, table default) Not advertised to any peer 100 10.0.1.1 from 10.0.1.1 (10.0.1.1) Origin incomplete, metric 0, valid, external, best (AS Path) AddPath ID: RX 2, TX-All 0 TX-Best-Per-AS 0 TX-Best-Selected 0 Last update: Thu Mar 5 15:46:06 2026 100 200 10.0.1.1 from 10.0.1.1 (10.0.1.1) Origin incomplete, valid, external AddPath ID: RX 5, TX-All 0 TX-Best-Per-AS 0 TX-Best-Selected 0 Last update: Thu Mar 5 15:46:06 2026
Attention
Verify addpath TX is advertised on the neighbor.
Step 6: Run command protocols bgp show ip neighbors neighbor receiver at DUT0 and check if output matches the following regular expressions:
IPv4 Unicast: TX advertisedShow output
BGP neighbor is 10.0.1.2, remote AS 300, local AS 100, external link Local Role: undefined Remote Role: undefined Hostname: osdx Member of peer-group RECEIVERS for session parameters BGP version 4, remote router ID 10.0.1.2, local router ID 10.0.1.1 BGP state = Established, up for 00:00:02 Last read 00:00:01, Last write 00:00:01 Hold time is 90 seconds, keepalive interval is 30 seconds Configured hold time is 90 seconds, keepalive interval is 30 seconds Configured tcp-mss is 0, synced tcp-mss is 1448 Configured conditional advertisements interval is 60 seconds Neighbor capabilities: 4 Byte AS: advertised and received AddPath: IPv4 Unicast: TX advertised IPv4 Unicast: RX advertised and received Paths-Limit: IPv4 Unicast: advertised (0) and received (0) Long-lived Graceful Restart: advertised and received Address families by peer: Route refresh: advertised and received Enhanced Route Refresh: advertised and received Address Family IPv4 Unicast: advertised and received Hostname Capability: advertised (name: osdx,domain name: n/a) received (name: osdx,domain name: n/a) Version Capability: not advertised not received Link-Local Next Hop Capability: not advertised not received Graceful Restart Capability: advertised and received Remote Restart timer is 120 seconds Address families by peer: none Graceful restart information: End-of-RIB send: IPv4 Unicast End-of-RIB received: IPv4 Unicast Local GR Mode: Helper* Remote GR Mode: Helper R bit: True N bit: True Timers: Configured Restart Time(sec): 120 Received Restart Time(sec): 120 Configured LLGR Stale Path Time(sec): 0 IPv4 Unicast: F bit: False End-of-RIB sent: Yes End-of-RIB sent after update: Yes End-of-RIB received: Yes Timers: Configured Stale Path Time(sec): 360 LLGR Stale Path Time(sec): 0 Message statistics: Inq depth is 0 Outq depth is 0 Sent Rcvd Opens: 2 2 Notifications: 1 0 Updates: 9 1 Keepalives: 1 1 Route Refresh: 2 1 Capability: 0 0 Total: 15 5 Prefix statistics: Inbound filtered: 0 AS-PATH loop: 0 Originator loop: 0 Cluster loop: 0 Invalid next-hop: 0 Withdrawn: 0 Attributes discarded: 0 Minimum time between advertisement runs is 0 seconds For address family: IPv4 Unicast RECEIVERS peer-group member Update group 2, subgroup 2 Packet Queue length 0 Advertise bestpath per AS via addpath Community attribute sent to this neighbor(all) Outbound path policy configured Route map for outgoing advertisements is *PERMIT Inbound updates discarded due to missing policy 0 accepted, 5 sent prefixes Connections established 1; dropped 0 Last reset never External BGP neighbor may be up to 1 hops away. Local host: 10.0.1.1, Local port: 179 Foreign host: 10.0.1.2, Foreign port: 42990 Nexthop: 10.0.1.1 Nexthop global: fe80::dcad:beff:feef:6c01 Nexthop local: fe80::dcad:beff:feef:6c01 BGP connection: shared network BGP Connect Retry Timer in Seconds: 30 Estimated round trip time: 0 ms Read thread: on Write thread: on FD used: 27