Map SD-WAN member priorities to BGP MED attribute when spoke advertises routes using iBGP to hub 7.6.1
When a spoke advertises routes using iBGP to a hub, SD-WAN member priorities are mapped into the BGP multiple exit discriminator (MED) attribute using the following CLI commands:
config system sdwan config neighbor edit <bgp-peer-IP> set member <num_1> ... <num_n> set route-metric {preferable | priority} set health-check <health-check-name> next end end
Value |
Description |
---|---|
preferable |
Select neighbor based on its HC to match BGP preferable/unpreferable route_map. |
priority |
Select neighbor based on its members' priority-in-sla/priority-out-sla value. |
Routes to prefixes behind spokes are advertised by the SD-WAN hub to eBGP peers on an external network. The relative values of the BGP MED attribute for each hub are used to indicate to eBGP peers the more preferred paths, that is, the preferred hub used to route to spoke prefixes.
This enhancement depends on the spoke SD-WAN configuration defined in Embed SLA priorities in ICMP probes and hub SD-WAN and BGP configuration defined in Embed SLA status in ICMP probes.
Example
This example includes one spoke and two hubs:
-
The spoke has two overlays to Hub-1 and Hub-2 respectively.
-
BGP neighbors between the spoke and hubs are over loopback IP addresses
-
SD-WAN is configured on the spoke.
To configure and test the example:
-
Enable recursive inherit priority on the hubs:
config router bgp set recursive-inherit-priority enable end
See Embedded SD-WAN SLA information in ICMP probes for more information.
-
Configure SD-WAN on the spoke:
config system sdwan set status enable config zone edit "overlay" next end config members edit 4 set interface "H1_T11" set zone "overlay" set source 172.31.0.65 set priority-in-sla 50 set priority-out-sla 100 next edit 5 set interface "H1_T22" set zone "overlay" set source 172.31.0.65 set priority-in-sla 70 set priority-out-sla 120 next edit 7 set interface "H2_T11" set zone "overlay" set source 172.31.0.65 set priority-in-sla 60 set priority-out-sla 110 next edit 8 set interface "H2_T22" set zone "overlay" set source 172.31.0.65 set priority-in-sla 80 set priority-out-sla 130 next end config health-check edit "HUB" set server "172.31.100.100" set embed-measured-health enable set sla-id-redistribute 1 set sla-fail-log-period 10 set sla-pass-log-period 10 set members 4 5 7 8 config sla edit 1 set link-cost-factor latency set latency-threshold 100 next end next end config neighbor edit "172.31.0.1" set member 4 5 set route-metric priority set health-check "HUB" next edit "172.31.0.2" set member 7 8 set route-metric priority set health-check "HUB" next end end
The routes with MEDs are advertised to a router on the external network that establishes a BGP neighbor relationship with Hub-1 and Hub-2. When sending traffic destined for 10.0.3.0/24, the router on the external network will prefer to send traffic to the hub with the lower MED.
-
All overlays are in SLA.
When sending traffic destined for 10.0.3.0/24, the router on the external network will prefer to send traffic to Hub-1 with lower MED 50 over Hub-2 with higher MED 60.
# diagnose sys sdwan health-check Health Check(HUB): Seq(4 H1_T11): state(alive), packet-loss(0.000%), latency(0.225), jitter(0.035), mos(4.404), bandwidth-up(999998), bandwidth-dw(999997), bandwidth-bi(1999995), sla_map=0x1 Seq(5 H1_T22): state(alive), packet-loss(0.000%), latency(0.203), jitter(0.016), mos(4.404), bandwidth-up(999998), bandwidth-dw(999998), bandwidth-bi(1999996), sla_map=0x1 Seq(7 H2_T11): state(alive), packet-loss(0.000%), latency(0.260), jitter(0.035), mos(4.404), bandwidth-up(999997), bandwidth-dw(999997), bandwidth-bi(1999994), sla_map=0x1 Seq(8 H2_T22): state(alive), packet-loss(0.000%), latency(0.201), jitter(0.018), mos(4.404), bandwidth-up(999998), bandwidth-dw(999998), bandwidth-bi(1999996), sla_map=0x1
# get router info bgp neighbors 172.31.0.1 advertised-routes VRF 0 BGP table version is 31, local router ID is 172.31.0.65 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.0.3.0/24 172.31.0.65 50 100 32768 0 i <-/-> Total number of prefixes 1
# get router info bgp neighbors 172.31.0.2 advertised-routes VRF 0 BGP table version is 31, local router ID is 172.31.0.65 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.0.3.0/24 172.31.0.65 60 100 32768 0 i <-/-> Total number of prefixes 1
-
H1_T11 is out of SLA.
When sending traffic destined for 10.0.3.0/24, the router on the external network will prefer to send traffic to Hub-2 with lower MED 60 over Hub-1 with higher MED 70.
# diagnose sys sdwan health-check Health Check(HUB): Seq(4 H1_T11): state(alive), packet-loss(0.000%), latency(120.225), jitter(0.037), mos(4.338), bandwidth-up(999997), bandwidth-dw(999996), bandwidth-bi(1999993), sla_map=0x0 Seq(5 H1_T22): state(alive), packet-loss(0.000%), latency(0.203), jitter(0.015), mos(4.404), bandwidth-up(999998), bandwidth-dw(999997), bandwidth-bi(1999995), sla_map=0x1 Seq(7 H2_T11): state(alive), packet-loss(0.000%), latency(0.249), jitter(0.026), mos(4.404), bandwidth-up(999998), bandwidth-dw(999996), bandwidth-bi(1999994), sla_map=0x1 Seq(8 H2_T22): state(alive), packet-loss(0.000%), latency(0.205), jitter(0.018), mos(4.404), bandwidth-up(999998), bandwidth-dw(999997), bandwidth-bi(1999995), sla_map=0x1
# get router info bgp neighbors 172.31.0.1 advertised-routes VRF 0 BGP table version is 31, local router ID is 172.31.0.65 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.0.3.0/24 172.31.0.65 70 100 32768 0 i <-/-> Total number of prefixes 1
# get router info bgp neighbors 172.31.0.2 advertised-routes VRF 0 BGP table version is 31, local router ID is 172.31.0.65 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.0.3.0/24 172.31.0.65 60 100 32768 0 i <-/-> Total number of prefixes 1
-
H1_T11 and H2_T11 are out of SLA.
When sending traffic destined for 10.0.3.0/24, the router on the external network will prefer to send traffic to Hub-1 with lower MED 70 over Hub-2 with higher MED 80.
# diagnose sys sdwan health-check Health Check(HUB): Seq(4 H1_T11): state(alive), packet-loss(0.000%), latency(120.194), jitter(0.011), mos(4.338), bandwidth-up(999997), bandwidth-dw(999997), bandwidth-bi(1999994), sla_map=0x0 Seq(5 H1_T22): state(alive), packet-loss(0.000%), latency(0.191), jitter(0.008), mos(4.404), bandwidth-up(999998), bandwidth-dw(999998), bandwidth-bi(1999996), sla_map=0x1 Seq(7 H2_T11): state(alive), packet-loss(0.000%), latency(120.235), jitter(0.029), mos(4.338), bandwidth-up(999997), bandwidth-dw(999997), bandwidth-bi(1999994), sla_map=0x0 Seq(8 H2_T22): state(alive), packet-loss(0.000%), latency(0.215), jitter(0.016), mos(4.404), bandwidth-up(999998), bandwidth-dw(999998), bandwidth-bi(1999996), sla_map=0x1
# get router info bgp neighbors 172.31.0.1 advertised-routes VRF 0 BGP table version is 31, local router ID is 172.31.0.65 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.0.3.0/24 172.31.0.65 70 100 32768 0 i <-/-> Total number of prefixes 1
# get router info bgp neighbors 172.31.0.2 advertised-routes VRF 0 BGP table version is 31, local router ID is 172.31.0.65 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.0.3.0/24 172.31.0.65 80 100 32768 0 i <-/-> Total number of prefixes 1
-
H1_T11, H2_T11, and H1_T22 are out of SLA.
When sending traffic destined for 10.0.3.0/24, the router on the external network will prefer to send traffic to Hub-2 with lower MED 80 over Hub-1 with higher MED 100.
# diagnose sys sdwan health-check Health Check(HUB): Seq(4 H1_T11): state(alive), packet-loss(0.000%), latency(120.199), jitter(0.016), mos(4.338), bandwidth-up(999997), bandwidth-dw(999996), bandwidth-bi(1999993), sla_map=0x0 Seq(5 H1_T22): state(alive), packet-loss(0.000%), latency(120.190), jitter(0.012), mos(4.338), bandwidth-up(999998), bandwidth-dw(999997), bandwidth-bi(1999995), sla_map=0x0 Seq(7 H2_T11): state(alive), packet-loss(0.000%), latency(120.251), jitter(0.022), mos(4.338), bandwidth-up(999997), bandwidth-dw(999996), bandwidth-bi(1999993), sla_map=0x0 Seq(8 H2_T22): state(alive), packet-loss(0.000%), latency(0.211), jitter(0.014), mos(4.404), bandwidth-up(999998), bandwidth-dw(999997), bandwidth-bi(1999995), sla_map=0x1
# get router info bgp neighbors 172.31.0.1 advertised-routes VRF 0 BGP table version is 31, local router ID is 172.31.0.65 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.0.3.0/24 172.31.0.65 100 100 32768 0 i <-/-> Total number of prefixes 1
# get router info bgp neighbors 172.31.0.2 advertised-routes VRF 0 BGP table version is 31, local router ID is 172.31.0.65 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.0.3.0/24 172.31.0.65 80 100 32768 0 i <-/-> Total number of prefixes 1
-
All of the overlays are out of SLA.
When sending traffic destined for 10.0.3.0/24, the router on the external network will prefer to send traffic to Hub-1 with lower MED 100 over Hub-2 with higher MED 110.
# diagnose sys sdwan health-check Health Check(HUB): Seq(4 H1_T11): state(alive), packet-loss(0.000%), latency(120.201), jitter(0.013), mos(4.338), bandwidth-up(999997), bandwidth-dw(999997), bandwidth-bi(1999994), sla_map=0x0 Seq(5 H1_T22): state(alive), packet-loss(0.000%), latency(120.187), jitter(0.008), mos(4.338), bandwidth-up(999998), bandwidth-dw(999998), bandwidth-bi(1999996), sla_map=0x0 Seq(7 H2_T11): state(alive), packet-loss(0.000%), latency(120.251), jitter(0.023), mos(4.338), bandwidth-up(999997), bandwidth-dw(999997), bandwidth-bi(1999994), sla_map=0x0 Seq(8 H2_T22): state(alive), packet-loss(0.000%), latency(120.194), jitter(0.010), mos(4.338), bandwidth-up(999998), bandwidth-dw(999998), bandwidth-bi(1999996), sla_map=0x0
# get router info bgp neighbors 172.31.0.1 advertised-routes VRF 0 BGP table version is 31, local router ID is 172.31.0.65 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.0.3.0/24 172.31.0.65 100 100 32768 0 i <-/-> Total number of prefixes 1
# get router info bgp neighbors 172.31.0.2 advertised-routes VRF 0 BGP table version is 31, local router ID is 172.31.0.65 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight RouteTag Path *>i10.0.3.0/24 172.31.0.65 110 100 32768 0 i <-/-> Total number of prefixes 1