I am looking to create a pseudo-fallback WAN connection in my router which does not natively support this.
I have a network of 192.168.93.0/24, my 'main' router and default gateway is on 192.168.93.1, this is the DHCP server as well and it hands out it's own IP as default gateway for all clients.
Then I have a 2nd router which has a 4G connection on IP address 192.168.93.2, this router does not do DHCP.
Now I've been studying my 1st router, which connects to a WiFi hotspot for its WAN connection. Whenever this connection succeeds, it adds a route to its routing table (destination 0.0.0.0/0 - so whole internet) to whatever IP the WiFi hotspot gateway is with a metric of 0.
So I figured I add a manual entry to it's routing table, with the same destination network of 0.0.0.0/0 but a gateway of 192.168.93.2 (my 2nd 4G router).
This seems to work on some level, as that I can perfectly ping to anywhere on the internet, when my 1st router does not have it's Wifi hotspot connected. However, when I try to browse somewhere using e.g. chrome, all requests time out.
When I start a wireshark trace on the client, I see a lot of worrying logs, like:
- TCP Retransmission
- Spurious retransmisssion
- TCP Dup ACK
Now when I delete the 0.0.0.0/0 route to 192.168.93.1 (1st router) on my client, when reconfigure it to go directly to 192.168.93.2 (2nd router), everything works fine.
Now that I'm thinking about this I'm wondering whether this can work at all, but why is the ping then working fine? In any case would be great if someone could explain exactly why this is not working.
Hmm ... depends on what your first router is actually doing in this case when default-route (0.0.0.0/0) points back to the internal network (your 4G router).
Compare the wireshark traces of the ping (icmp-echo-request/response) with another trace of the TCP-connect (that is established when browsing).
Do you see any TCP(syn-ack) coming back from the server to your client.
Further look at the MAC-Address in Wireshark to see if the incoming packets are coming from the 1st or 2nd router to your client.