Dynamic route pref-src selection

When a route is learned through some dynamic routing protocol, such as OSPF, how is the pref-src selected for locally originated packets?

In my case, I have two IP addresses on the interface, one for backhaul antenna management and one for the PtP between routers. The router is silently selecting the management IP for pref-src on OSPF routes, meaning that the management IP is showing up in traceroutes etc (not a desirable outcome).

So my questions are:

  • Exactly what criteria does the router use to select the pref-src for a dynamic route; and,
  • Is there any way to influence this choice?

TIA.

Locally originated packets get ip address set as pref-src of connected route. To force specific address, pref-src can be changed with routing filters or forced with srcnat.

Thanks for your reply.

The connected route of what? The dynamic route’s next hop/gateway?

That doesn’t seem to be the case - The gateway of the IP route is the public IP. I should probably mention that MPLS is in use here. The router that is originating packets with the management IP is the PHPing router in the LSP. But the next hop in the MPLS forwarding table is also the public IP on the other end of the PtP, not the management one.