Have you tried setting the preferred src address of the route(s) to the addresses you desire?
From "man ip": > src ADDRESS the source address to prefer when sending to the destinations > covered by the route prefix. On 19 February 2023 09:01:31 CET, Nico Schottelius <[email protected]> wrote: > >Let me rephrase the problem statement: > > - ping and http calls to the multi homed machine work correctly: > I can ping 147.78.195.254 and the reply contains the same address. > I can ping 195.141.200.73 and the reply contains the same address. > I can curl 147.78.195.254 and the reply contains the same address. > I can curl 195.141.200.73 and the reply contains the same address. > > - wireguard does NOT work because it changes the reply address: > A packet sent to 147.78.195.254 is being replied with 195.141.200.73 > >In general, processes reply with the IP address that was used to contact >them and not with the outgoing interface address, which would also break >adding IP addresses to the loopback interface. > >For full detail, see ip addresses [0] and routing below [1] and tests >executed [2]. > >I believe that this is a bug in wireguard.
