How to update route depending on the incoming interface

Hello,

I have clients that can use two different routes (over vpn tunnels on R2 as depicted in the figure below) to talk to the server behind R1. The route over tunnels on R2 can change depending on some link characteristics.
The Router R1 will forward packet to server, independently of the incoming interface.
The question is, how can I make the Router R1 forward packets (coming from server response, colored in red in the figure) to the client, using the last tunnel interface, from which the client sends its packets?
For example:

  1. Client send req1 to server, using tun1
  2. Router R1 update its routing table as follow : client is reachable on tun1
  3. Server respond to client (packet will pass through tun1 according to the last update of the routing table)
  4. Link characteristics changed, and now Client send req2 to server, using tun2
  5. Router R1 update its routing table as follow : client is reachable on tun2
  6. Server respond to client (packet will pass through tun2 according to the last update of the routing table)
  7. etc

I am working with vyos 1.4.0-rc3.

Note that the vpn server have only 1 public (static) IP address (for both tunnel1 and tunnel2). Vyos-vpn-client have a nated dynamic IP on each ISP.

Thank you.

multi-wan.drawio (2)

Do you have any idea how to do it ?

You probably want to contact support.