0

I use a laptop, which has two physical network interfaces: wireless (IF 11 as printed by route) & Ethernet (IF 12). I have two routers R1 & R2, but only the first one does have an internet connection. My goal is to route all traffic via R1, but route all requests on a subnet, controlled by R2 (e.g. 192.168.2.x) through R2.

Windows prefers cable connection over WiFi by default, so I changed the metric for the wireless adapter to be lower then the metric of IF 12.

Is there a way do block the OS from creating the default 0.0.0.0route for the ethernet adapter?

Eralde
  • 3
  • 1

1 Answers1

1

You should be able to accomplish this by not setting a default gateway in the NIC for internal use. If you only set a default gateway on the "Internet" NIC, then you may just need to add a route in Windows with the -p for persistent. You would need to add routes for all networks other than the directly connected subnets.

ROUTE -P ADD 10.10.10.0 MASK 255.255.255.0 192.168.1.1 METRIC 1
Cory Knutson
  • 1,876
  • 13
  • 20
  • Can I do that (not setting the default gateway) with the `route` command? – Eralde Apr 21 '17 at 07:49
  • If you put a default gateway in the config, it will make the route in the windows routing table, you could use "route DEL" to remove it, but I am not sure if you can make that survive a reboot. – Cory Knutson Apr 21 '17 at 11:59