Skip to contentSkip to conversation

Wireguard metric problem Openwrt(19.07.5 Stable) + Mwan3

DISCUSSION Евгений Глущенко 1 participant 1 message Jan 4, 2021

lore
Share & tools
lore
#0 lore raw

There was a problem using wireguard on OpenWrt(19.07.5 Stable) with mwan3 package and dynamic routing. The system is configured according to the fail over principle. There are two interfaces (wan and wanb(LTE)) wan interface is the main one and everything works fine with it.
But when wan is disabled, all traffic is redirected to wanb, but the wireguard continues to use the wan interface, since it has a wan interface metric 10 and a wanb metric 20. All internet user traffic is going out from wan or wanb interface.
On wan
WGClient(10.66.66.3)--VPS(212.x.x.x 10.66.66.1)-wan (172.17.165.64)- Openwrt(10.66.66.2 192.168.0.1)-LAN(192.168.0.0/24)
or when wan is down
WGClient(10.66.66.3)--VPS(212.x.x.x 10.66.66.1)-wanb (192.168.8.1)- Openwrt(10.66.66.2 192.168.0.1)-LAN(192.168.0.0/24)
WG Client access to only lan without Internet throw VPS.
All work fine on wan ! But when wan down and up wanb ping 10.66.66.1 100% lost but lan clients is going to the internet normal.
When i disable wan interface ping 10.66.66.1  ok on wanb.

Output of "ip route list table 1-250"
Table 1:
default via 172.17.165.1 dev eth0.2 metric 10 10.66.66.0/24 dev wg proto static scope link 172.17.165.0/24 dev eth0.2 proto static scope link metric 10 192.168.0.0/24 dev br-lan proto kernel scope link src 192.168.0.1 192.168.8.0/24 dev eth2 proto static scope link metric 20 212.x.x.x via 192.168.8.1 dev eth2 proto static metric 20 Table 2:
default via 192.168.8.1 dev eth2 metric 20 10.66.66.0/24 dev wg proto static scope link 172.17.165.0/24 dev eth0.2 proto static scope link metric 10 192.168.0.0/24 dev br-lan proto kernel scope link src 192.168.0.1 192.168.8.0/24 dev eth2 proto static scope link metric 20 212.x.x.x via 192.168.8.1 dev eth2 proto static metric 20