The bestroute nexthop-priority command configures a device to select a IPv4 or IPv6 route with a higher priority after the route learned by IPv4 is advertised to a public network.
The undo bestroute nexthop-priority command restores the default setting.
By default, BGP selects routes based on the default route selection rules and does not compare next hop types.
Usage Scenario
In a global IPv4 over SRv6 BE scenario where IPv4 and IPv6 services coexist, a device may have two routes with the same prefix but different next hops. The next hop of one route uses an IPv4 address, and that of the other route uses an IPv6 address. To enable the device to preferentially select a route with an IPv4 or IPv6 next hop address, run the bestroute nexthop-priority command.