Wireguard netifd script and mwan3

/lib/netifd/proto/wireguard.sh proto_wireguard_setup adds a host route to the VPN server via WAN device of the default route. This host route seems unnecessary. Deleting it has no effect. Furthermore, if there is a second WAN interface, used in conjunction with mwan3, failover of VPN WAN1/WN2 still works.

However, /etc/config/mwan3 does not seem to work if it is desired to forward VPN traffic via a specific WAN. I was wondering if anyone was able to do this.

It seems that the host route is still needed if the VPN needs to be explicitly restricted to a specific WAN interface. I was able to implement it via the /etc/mwan3.user script.

This seems a bit of a hack. Perhaps there is something I don't understand about mwan3.

Wireguard adding explicit route to endpoint to the routing table - #2 by vgaetera

Thank you!

I have a related question. The wireguard.sh call to proto_add_host_dependency ends up in a call "ubus -S call network.interface notify_proto". This seems wrong. Would not it be better to call "ubus call network add_host_route"? This way it would be possible to specify the wan interface device and not always end up with default.