I'm trying to configure the following:
- General access to internet - via WiFi
- Access to specific internet IPs - via USB Tethering on mobile phone
I run command ...
route add 123.123.123.0 mask 255.255.255.0 192.168.42.106 metric 1
... with the expectation of that route to get higher priority than WiFi network - thus achieving the goal 'Access to specific internet IPs via USB Tethering on mobile phone', but it gets `metric of mobile network + 1' and actually that route is ignored because WiFi has higher priority (tracert 123.123.123.1 starts at 192.168.0.1)
Here are the top lines of resulting route table (192.168.0.1 - WiFi network, 192.168.42.129 - Mobile network via USD tethering)
IPv4 Route Table===========================================================================Active Routes:Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.160 8 0.0.0.0 0.0.0.0 192.168.42.129 192.168.42.106 15 123.123.123.0 255.255.255.0 On-link 192.168.42.106 16 123.123.123.255 255.255.255.255 On-link 192.168.42.106 271 127.0.0.0 255.0.0.0 On-link 127.0.0.1 331 127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
Q: Why route at line 3 gets metric=16
and not metric=1
as I expect?
Q: Probably there is better/simpler way to achieve my goals?