Hi guys! Please advice how implement logic of source-ip routing on OpenWRT 22.03.2 ?
Have a regular WAN uplink and Wireguard wg0 VPN uplink where traffic routes there based on IP/subnet ipset list with using mark routing.
Inside LAN have a specific device which need to route all it's traffic inside wg0 tunnel... Is it possible to do this somehow?
PS tried setup Network -> Routing-> Ipv4 rules with entry like this:
config rule
option src '192.168.0.74/24'
option out 'wg0'
option in 'lan'
but unfortunately traffic from this 192.168.0.74 client still routes via WAN:
>tracert google.com
1 3 ms 1 ms <1 мс OpenWrt.lan [192.168.0.1]
2 4 ms 5 ms 3 ms 172.xx.xx.1
...
PS in case of requesting IP from pre-defined ipset the same 192.168.0.74 client routes via wg0
tracert 157.240.247.174
1 33 ms 1 ms 1 ms OpenWrt.lan [192.168.0.1]
2 82 ms 81 ms 81 ms 10.7.0.1
...
Is there any way to implement source-ip routing or some tricky firewall rule? Thanks in advice!
You need a set of rules/routes for the wg connection. And you don't need the option out 'wg0' . Also the source is wrong. Use either .74/32 for a single host or .0/24 for the whole subnet.