Hi. My setup: I have 2 ISPs, OpenWRT is running in a VM and I have multiwan setted for outgoing traffic. A VM behind OpenWRT is used as wireguard server on port 38195 ip 192.168.10.254.
When incoming traffic comes to WAN1 everything is working well. If traffic is coming to WAN2, OpenWRT doesn't honor the outgoing interface from answer traffic of the internal VM, please see attached file for a complete pcap capture, ip rules and routes.
Return traffic will take the default route out so if traffic comes in via a non default route you have to use policy based routing to make sure it will go out the same way.
Thanks for your answer. I thought about marking packet but from what I read in documentations, I don't know if it had to be done in the GUI or in users rule of nftables.
root@guava:~# ip rule sh
0: from all lookup local
1: from 192.168.136.0/24 lookup 201
2: from yyy.zzz.252.179 lookup 202
1001: from all iif bone.1001 lookup 1
1002: from all iif bone.1002 lookup 2
2001: from all fwmark 0x100/0x3f00 lookup 1
2002: from all fwmark 0x200/0x3f00 lookup 2
2061: from all fwmark 0x3d00/0x3f00 blackhole
2062: from all fwmark 0x3e00/0x3f00 unreachable
3001: from all fwmark 0x100/0x3f00 unreachable
3002: from all fwmark 0x200/0x3f00 unreachable
32766: from all lookup main
32767: from all lookup default
root@guava:~# cat /etc/iproute2/rt_tables
#
# reserved values
#
128 prelocal
255 local
254 main
253 default
0 unspec
#
# local
#
#1 inr.ruhep
something is wrong, what? Should table 202 and 202 not be existing in rt_tables?
The gateway is the next hop unless it is a point to point link (e.g. a VPN) in which case it can be omitted, see for some more explanation: OpenWRT Policy Based Routing (PBR)
See the paragraph about Create Routing Tables via the wan
ifstatus [wan|wanb]|grep nexthop shows nothing. Anyway, nexthop is the default gateway, I already know their value. I followed the pdf but now outgoing traffic does not honor anymore load balancer, always going out using wan/bone.1001