The situation: I have a backbone network with multiple gateway-capable routers 192.168.17.0/24. Since mwan3 and pbr do not like have multiple default gateways on the same network, I had to create a macvlan device to fake another interface on the same network with its own gateway.
config interface 'wan'
option device 'eth0.21'
option proto 'static'
list ipaddr '192.168.17.1/24'
option gateway '192.168.17.5'
config device 'macvlan0'
option name 'macvlan0'
option type 'macvlan'
option ifname 'eth0.21'
config interface 'wan2'
option device 'macvlan0'
option proto 'static'
list ipaddr '192.168.17.2/24'
option gateway '192.168.17.6'
/etc/init.d/pbr restart
Routing 'test1' via wan2 [✗]
Installing fw4 nft file [✓]
Setting interface trigger for wan [✓]
pbr 1.2.1-r87 monitoring interfaces: wan
pbr 1.2.1-r87 (fw4 nft file mode) started with gateways:
wan/eth0.21/192.168.17.5 [✓]
ERROR: Policy 'test1' has an unknown interface!
ERROR: Errors encountered, please check https://docs.openwrt.melmac.ca/pbr/1.2.1/#ErrorMessagesDetails!
Can someone confirm this bug? Are there any solutions?
Things work well. One small problem though: the policies are not applied to traffic originated from the OpenWrt device itself. Is there any way to make it applied to the localhost?
Well the OUTPUT chain is what works for the router itself I use it for routing DNS request and that works for me.
I noticed that you are using domains destination, you might want to have a look at:
If that does not help then better start a new thread with this particular problem and provide the following information:
Please connect to your OpenWRT device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button
Remember to redact keys, passwords, MAC addresses and any public IP addresses you may have but do not redact private RFC 1918 IP addresses as that is not needed:
ubus call system board
cat /etc/config/network
cat /etc/config/firewall
ip route show
ip -6 route show
ip route show table all
ip rule show
cat /etc/config/pbr
service pbr restart
service pbr status