Routing LAN traffic from Edgerouter to wg0
Did you add the 0.0.0.0/1
and 128.0.0.0/1
to the main route table?
What is the IP of the wireguard server you connected to? if you have those 3 routes, and nothing else, then how is your wireguard client going to reach the remote? If you put everything on the main table, then you must also add a static route that goes out your main interface for the IP of the wireguard server.
Your OpenVPN server is probably pushing a route for the special remote_host which the OpenVPN client resolves to whatever IP that it connected to.
If you set the AllowedIPs = 0.0.0.0/0
in your wireguard configuration, wg-quick actually does some magic for you to handle this that is pretty neat and easy.
These ip rules are added, and an additional route table is added.
$ ip rule
32764: from all lookup main suppress_prefixlength 0
32765: not from all fwmark 0xca6c lookup 51820
32766: from all lookup main
# ip route show table 51820
default dev wg0 scope link
The wireguard will by default add a fwmark to all the packets to the value 51820 (51820 is 0xca6c in hex).
The rule from all lookup main suppress_prefixlength 0
will ignore the default route on your main table..
Traffic directly to the wireguard peer external IP will not be marked with the fwmark so it will use the 32766 and go out the default route.
Anyway the point is, you probably don't need or want the 0.0.0.0/1
and 128.0.0.0/1
with wireguard on Linux. It has better ways of handling redirecting the default gateway then what OpenVPN has out of the box.