On Junos, only active BGP routes are advertised to peers. If we want to change this behavior we need to set the advertise-inactive BGP knob.
The following example walks through this process.
Lab Environment
The lab is set up as per the below diagram.

- vMX-1 and vMX-2 belong to AS 65002.
- vMX-3 belongs to AS 65001.
- iBGP is already configured between vMX-1 and vMX-2.
- eBGP is already configured between vMX-2 and vMX-3.
- vMX-1 is advertising 172.16.101.0/24 through to 172.16.104.0/24 to vMX-2
- vMX-2 is on-advertising these routes to vMX-3.
- vMX-3 is not advertising any routes to vMX-2.
Lab Baseline
On vMX-2 we have four BGP routes being learned from vMX-1.
lab@vMX-2> show route protocol bgp
inet.0: 18 destinations, 19 routes (18 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
172.16.101.0/24 *[BGP/170] 00:37:06, localpref 100, from 172.16.1.1
AS path: I, validation-state: unverified
> to 192.168.1.2 via ge-0/0/0.0
172.16.102.0/24 [BGP/170] 00:37:06, localpref 100, from 172.16.1.1
AS path: I, validation-state: unverified
> to 192.168.1.2 via ge-0/0/0.0
172.16.103.0/24 *[BGP/170] 00:37:06, localpref 100, from 172.16.1.1
AS path: I, validation-state: unverified
> to 192.168.1.2 via ge-0/0/0.0
172.16.104.0/24 *[BGP/170] 00:25:32, localpref 100, from 172.16.1.1
AS path: I, validation-state: unverified
> to 192.168.1.2 via ge-0/0/0.0
inet6.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
lab@vMX-2>
If you look closely, you will notice a small difference with the 172.16.102.0/24 route. It does not have a ‘*’ to denote it as an active route.
Looking at the inet.0 route table as a whole, instead of just the BGP routes, makes this more obvious.
lab@vMX-2> show route table inet.0
inet.0: 18 destinations, 19 routes (18 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
<<output removed for brevity>>
...
172.16.101.0/24 *[BGP/170] 00:40:26, localpref 100, from 172.16.1.1
AS path: I, validation-state: unverified
> to 192.168.1.2 via ge-0/0/0.0
172.16.102.0/24 *[OSPF/150] 00:21:58, metric 0, tag 0
> to 192.168.1.2 via ge-0/0/0.0
[BGP/170] 00:40:26, localpref 100, from 172.16.1.1
AS path: I, validation-state: unverified
> to 192.168.1.2 via ge-0/0/0.0
172.16.103.0/24 *[BGP/170] 00:40:26, localpref 100, from 172.16.1.1
AS path: I, validation-state: unverified
> to 192.168.1.2 via ge-0/0/0.0
172.16.104.0/24 *[BGP/170] 00:28:52, localpref 100, from 172.16.1.1
AS path: I, validation-state: unverified
> to 192.168.1.2 via ge-0/0/0.0
...
<<output removed for brevity>>
lab@vMX-2>
It now becomes clear that vMX-2 has two routes to the 172.16.102.0/24 network and that the external OSPF route is selected as the active route due to route preference.
Checking what routes vMX-2 advertises to vMX-3, we can see only three routes listed.
lab@vMX-2> show route advertising-protocol bgp 192.168.2.1
inet.0: 18 destinations, 19 routes (18 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 172.16.101.0/24 Self I
* 172.16.103.0/24 Self I
* 172.16.104.0/24 Self I
lab@vMX-2>
Setting The Advertise-Inactive BGP Knob
Setting the advertise inactive knob can be done for a whole BGP group or an individual BGP neighbor.
We’ll set it for the group in this example.
[edit]
lab@vMX-2# show protocols bgp
group my-external-group {
type external;
authentication-key "$9$7mdw2ZUH5Qn4aQn/CB17-V"; ## SECRET-DATA
peer-as 65001;
neighbor 192.168.2.1;
}
group my-internal-group {
type internal;
local-address 172.16.1.2;
authentication-key "$9$GSjkmz39O1hfT1hSr8LGDi"; ## SECRET-DATA
export fix-nhs;
neighbor 172.16.1.1;
}
[edit]
lab@vMX-2# set protocols bgp group my-external-group advertise-inactive
[edit]
lab@vMX-2# show protocols bgp
group my-external-group {
type external;
advertise-inactive;
authentication-key "$9$7mdw2ZUH5Qn4aQn/CB17-V"; ## SECRET-DATA
peer-as 65001;
neighbor 192.168.2.1;
}
group my-internal-group {
type internal;
local-address 172.16.1.2;
authentication-key "$9$GSjkmz39O1hfT1hSr8LGDi"; ## SECRET-DATA
export fix-nhs;
neighbor 172.16.1.1;
}
[edit]
lab@vMX-2# commit
commit complete
[edit]
lab@vMX-2#
Validation
To validate this change, we can check what routes vMX-2 is advertising to vMX-3.
lab@vMX-2> show route advertising-protocol bgp 192.168.2.1
inet.0: 18 destinations, 19 routes (18 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 172.16.101.0/24 Self I
172.16.102.0/24 Self I
* 172.16.103.0/24 Self I
* 172.16.104.0/24 Self I
lab@vMX-2>
This time, the 172.16.102.0/24 route is being advertised. The output still shows a difference, which is the lack of a ‘*’ at the beginning.
Summary
Inactive routes are one reason we might not advertise a BGP route to a neighbor. This is easily fixed with the advertise-inactive knob.
If you are new to BGP on Junos take a look at this basic BGP configuration example.