PBR Over Wireguard

Untitled Diagram (2)

Router 1 is BGP announcing 1.2.3.4/32 upstream. Router 1 and Router 2 are in OSPF area 0. 10.3.13.0/31 is a wireguard tunnel between R1 and R2. 192.168.11.0/24 is in area 0 and the interface is passive. I need traffic that comes in to 1.2.3.4 in R1 to be 1-to-1 NATed to 192.168.11.50/24 and the return traffic to go through the wireguard tunnel to R1 and not out R2’s default gateway.

Create a new routing table (say table 100) on Router 2 and add a policy route that says “all traffic coming into 192.168.11.1 from 192.168.11.50 must use table 100”

me@R2# show policy
 route LAN-POLICY-BASED-ROUTING {
     rule 10 {
         source {
             address 192.168.11.50/24
         }
         set {
             table 100
         }
     }
 }
me@R2# show protocols static
 table 100 {
     interface-route 0.0.0.0/0 {
         next-hop-interface wgX { (change the X to your WireguardTunnel ID)
         }
     }
 }
[edit interfaces ethernet eth1]
me@R2# show
  vif 5
    address 192.168.11.1/24
    description "XXX Network"
    policy {
      route LAN-POLICY-BASED-ROUTING  
  }
}

I assume you know how to do the natting.