Windows 7: How to bind an interface to be only route to ip

2

1

I am running Windows 7, and need to route DNS traffic to 8.8.8.8 over a separate network interface without it passing through the primary (wired) interface. No other traffic should be routed through the second interface (3G) - partially due to speed and partially due to servers in the 10.x.x.x range. How can I configure Windows to route my traffic?

In particular, how can I configure Windows to not find a route to 8.8.8.8 when the second interface is not plugged in or disabled?

Result of running route print with second interface enabled:

===========================================================================
Interface List
 11..1c 6f 65 38 15 c3 ......Realtek PCIe GBE Family Controller
 20...8a 4e 09 12 1f 35 ......Remote NDIS based Internet Sharing Device
 1...........................Software Loopback Interface 1
 12...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
 13...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0         10.0.0.1       10.0.10.29     10
          0.0.0.0          0.0.0.0   192.168.42.129   192.168.42.205    266
         10.0.0.0      255.255.0.0         On-link        10.0.10.29    266
       10.0.10.29  255.255.255.255         On-link        10.0.10.29    266
     10.0.255.255  255.255.255.255         On-link        10.0.10.29    266
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
     192.168.42.0    255.255.255.0         On-link    192.168.42.205    266
   192.168.42.205  255.255.255.255         On-link    192.168.42.205    266
   192.168.42.255  255.255.255.255         On-link    192.168.42.205    266
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link        10.0.10.29    266
        224.0.0.0        240.0.0.0         On-link    192.168.42.205    266
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link        10.0.10.29    266
  255.255.255.255  255.255.255.255         On-link    192.168.42.205    266
===========================================================================
Persistent Routes:
  None

Iiridayn

Posted 2013-02-09T08:52:13.547

Reputation: 248

You do realise that we don't generally consider windows 7 'server' to be topical here don't you. [su] is a better place for that kind of question. – None – 2013-02-09T09:41:22.370

@Iain I had not realized it - the question is about workstation configuration in a large corporate office. As such I felt that it struck points 1 and 3 on the faq page. As you point out, since my issue could also be generalized to include home use, it also meets Super User posting standards ("specific issues with computer ... networking"). Would you be able to migrate it over? – Iiridayn – 2013-02-11T22:15:45.430

Answers

4

I have a partial success by running:

route -p add 8.8.8.8 mask 255.255.255.255 10.0.0.1 metric 1000 if 11
route -p add 8.8.8.8 mask 255.255.255.255 192.168.42.129 metric 1 if 20
route -p change 0.0.0.0 mask 0.0.0.0 192.168.42.129 metric 1000 if 20

The last line doesn't influence the standard value of 266 when I plug the second interface back in, and I have had to re-run it each time. Although traffic does not pass through the primary interface to reach 8.8.8.8 when the second interface is plugged in and configured, the routing table still permits connections to 8.8.8.8 over the standard interface. I verified these results using Wireshark, which I verified by manually providing the first interface to ping.

Posting this in case a partial answer is good enough for similar cases.

Iiridayn

Posted 2013-02-09T08:52:13.547

Reputation: 248

Marking as accepted as the solution was adequate and I don't need it now. Willing to accept a better answer. – Iiridayn – 2014-01-08T13:18:11.590

2

The NIC priority could be incorrect. With both NICs connected open

Control Panel\Network and Internet\Network Connections

Now press Alt + n to open the Advanced menu and click on Advanced Settings. Now select the NIC that you want to be the primary interface and move it to the top using the arrow buttons.

Brad

Posted 2013-02-09T08:52:13.547

Reputation: 241

I no longer work at that company, though I could probably set up the situation again from home. How would adjusting NIC priority prevent Windows from routing traffic to 8.8.8.8 when only 1 NIC is found? – Iiridayn – 2015-07-10T14:19:04.217