Manually Changing between WAN Ports

Hi,
I have been having issues with my local ISP. While I get the issue fixed I need to use an external 4G router as a temporary WAN connection. I've setup the connection and added on Openwrt. How do I now force this to be the default WAN connection? I've tried just stopping the WAN interface but that doesn't work.

Will double NAT be an issue i.e. 192.168.1.x to 192.168.8.x to Public IP

The mwan3 package is designed exactly for this application.

https://openwrt.org/docs/guide-user/network/wan/multiwan/mwan3

1 Like

I've previously used MWAN3, but I just want a quick manual changeover from WAN to WAN_4G. I've added the WAN_4G into the the same firewall Zone as the WAN, I must be missing something to make this the default next hop/ route.

If you add metrics to the interfaces, that will ensure that the respective routes stay loaded. Then you should be able to stop/start interfaces as you seem to be doing.

1 Like

Still can't get this working. I put the 4G Wan port on a lower metric then ISP PPPoE Wan port (Lan port 4), but it still only uses the PPPoE route. If I stop the PPPoE route then I loose internet. I'm trying to manually change the routing from-
192.168.1.x (home network) to 192.168.1.2 (Openwrt Router) to PPPoE (Public IP route on Lan Port 4)
New config....
192.168.1.x (home network) to 192.168.1.2 (Openwrt Router) to 192.168.8.x (DHCP Client on Lan Port 3) to 192.168.8.254 (4G mobile router).

I can't get Openwrt to use the DHCP Client Lan port on LAN3 as the next hop to the outside world.

Any ideas?

Both should be default route for metrics to work
Please show:

ip route show
ip route show table all

root@OpenWrt:~# ip route show
default via 192.168.8.254 dev lan3 proto static metric 10
default via 172.16.14.164 dev pppoe-wan proto static metric 30
10.22.22.0/24 dev wan proto static scope link metric 100
172.16.14.164 dev pppoe-wan proto kernel scope link src 81.158.98.173
192.168.1.0/24 dev br-lan proto kernel scope link src 192.168.1.2
192.168.2.0/24 dev wan proto static scope link metric 100
192.168.3.0/24 dev br-lan-iptv proto kernel scope link src 192.168.3.1
192.168.8.0/24 dev lan3 proto static scope link metric 10

root@OpenWrt:~# ip route show table all
default via 172.16.14.164 dev pppoe-wan table 1 proto static metric 30
10.22.22.0/24 dev wan table 1 proto static scope link metric 100
172.16.14.164 dev pppoe-wan table 1 proto kernel scope link src 81.158.98.173
192.168.1.0/24 dev br-lan table 1 proto kernel scope link src 192.168.1.2
192.168.2.0/24 dev wan table 1 proto static scope link metric 100
192.168.3.0/24 dev br-lan-iptv table 1 proto kernel scope link src 192.168.3.1
192.168.8.0/24 dev lan3 table 1 proto static scope link metric 10
default via 192.168.8.254 dev lan3 proto static metric 10
default via 172.16.14.164 dev pppoe-wan proto static metric 30

The first route has no metric meaning a metric of 0 so that route takes precedence

Sorry I updated my previous post. I also changed the 4G route to a static address 192.168.8.10 with a gateway of 192.168.8.254.
I can ping both of these addresses from the LAN, just can't route out via that interface.

Pinging 192.168.8.10 with 32 bytes of data:
Reply from 192.168.8.10: bytes=32 time=2ms TTL=64
Reply from 192.168.8.10: bytes=32 time<1ms TTL=64
Reply from 192.168.8.10: bytes=32 time<1ms TTL=64
Reply from 192.168.8.10: bytes=32 time<1ms TTL=64

Pinging 192.168.8.254 with 32 bytes of data:
Reply from 192.168.8.254: bytes=32 time=2ms TTL=63
Reply from 192.168.8.254: bytes=32 time=1ms TTL=63
Reply from 192.168.8.254: bytes=32 time=1ms TTL=63
Reply from 192.168.8.254: bytes=32 time=1ms TTL=63

You can check your route with e.g. :
ip route get 8.8.8.8 from 192.168.8.10

I also see table 1 how does that fit 1 ?

Check with: ip rule show

1 Like

root@OpenWrt:~# ip route get 8.8.8.8 from 192.168.8.10
8.8.8.8 from 192.168.8.10 via 192.168.8.254 dev lan3 uid 0
cache
root@OpenWrt:~# ip rule show
0: from all lookup local
1001: from all iif pppoe-wan lookup 1
2001: from all fwmark 0x100/0x3f00 lookup 1
2061: from all fwmark 0x3d00/0x3f00 blackhole
2062: from all fwmark 0x3e00/0x3f00 unreachable
3001: from all fwmark 0x100/0x3f00 unreachable
32766: from all lookup main
32767: from all lookup default

From my home computer....

C:\Users>tracert 192.168.8.254

Tracing route to 4G_Router [192.168.8.254]
over a maximum of 30 hops:

1 <1 ms 1 ms <1 ms 192.168.1.2
2 1 ms 1 ms 1 ms 192.168.8.254

mwan3 is still active.

/etc/init.d/mwan3 stop
/etc/init.d/mwan3 disable
/etc/init.d/network restart
1 Like

That's the reason :open_mouth: . I'm not sure how you could tell MWAN was still active from the traces. I've removed it and restarted the network. I can now change which WAN to use just by adjusting the metric. Lowest wins.
Thanks for everyones help!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.