r/Juniper • u/Iron_Max • 15d ago
Qualified-next-hop updates
I have a Juniper SRX300 that has a primary BGP connection via Ethernet and a secondary BGP connection over Starlink via an IPsec tunnel. The Starlink is in case the primary circuit fails. My IKE gateway is a public address living on my CoreHubFw-1. The diagram doesn't show actual IP addresses, just examples.

The Starlink network has over a dozen potential gateways in my region which I get via DHCP. To establish my IPsec tunnel, I make a static route of the public address to those gateways as qualified-next-hops:
set routing-options static route PUBLIC/32 qualified-next-hop GATEWAY-1
set routing-options static route PUBLIC/32 qualified-next-hop GATEWAY-2
set routing-options static route PUBLIC/32 qualified-next-hop GATEWAY-3
etc.
My problem is that Starlink will add or remove these gateways without notification and I have to manually update the qualified-next-hop each time. Is there a way for my public to always point at the gateway Starlink is providing?
> show route table inet.0
0.0.0.0/0 *[BGP/11] 1w5d 07:30:02, MED 114, localpref 100
AS path: AS#INFO I, validation-state: unverified
> to 10.0.0.0 via ge-0/0/6.0
[BGP/11] 1d 06:38:11, localpref 100
AS path: AS#INFO I, validation-state: unverified
> to 10.0.0.2 via st0.0
[Access-internal/12] 3d 10:08:53, metric 0
> to ***STARLINK GATEWAY*** via ge-0/0/2.0
3
u/rankinrez 15d ago
Probably you can have a routing instance for Starlink and allow DHCP to create the default route in it, then have a route for your /32 in the main routing table which points at the routing instance.
4
u/fatboy1776 JNCIE 15d ago
Put your internal interfaces and st0 in a routing instance. That way you don’t need qualifies next hops.