0

I have an environment where my work computer needs to be connected to two separate networks. My "lab" connection is via my ethernet NIC and I use wireless to connect to the outside world. (I have a separate machine for connecting to the corporate network.)

The wireless network consists of a basic wireless router connected to a cable modem. (my current ip on this network: 192.168.1.117)

The lab network is just a single machine running Windows Server 2003, and is a domain controller w/ DHCP enabled. (my current ip on this network: 10.1.1.1)

With default settings I can hit web pages hosted on the wired network but not on the wireless. If I disable the ethernet NIC and run ipconfig /renew then I can use the wireless network, but obviously not the wired.

If I assign the IP address on the wired NIC manually then it works, however, the next time I plug in to a network anywhere else I will inevitably wonder what's wrong until I remember to change my settings, and then I will have to change them back again.

I imagine I need to play with the ROUTE command more but I see that route add requires a destination network, and I want something more along the lines of "route everything on subnet 10.1.x.x through interface A, everything else through interface B."

Chloraphil
  • 251
  • 3
  • 5
  • 15

3 Answers3

5

Looks like you're connecting to two different networks, both of which use DHCP and both of which are handling you a default gateway. There's no way to solve this, you have to set something manually, those DHCP servers are just giving you conflicting informations, and this just doesn't work.

You can specify which default gateway to use with this command:

ROUTE ADD 0.0.0.0 MASK 0.0.0.0 a.b.c.d

Where "a.b.c.d." is your gateway's IP address. Try to set it to your wireless network's gateway. But I don't think this will work reliably as long as you keep using DHCP on both networks at the same time.

Massimo
  • 70,200
  • 57
  • 200
  • 323
  • +1: If you are bridging two networks, or if you are dual-homing a machine, do yourself a favor and set your IP addresses, masks and default gateway manually. DHCP is just asking for extra pain here. – voretaq7 Feb 17 '10 at 19:46
0

You should be able to add a static route for the 10.x.x.x network pointing to your ethernet interface and another 0.0.0.0/0 route pointing to your wireless.

Something like this:

route add 0.0.0.0 mask 0.0.0.0 <ip address of wireless router>
route add 10.0.0.0 mask 255.0.0.0 <ip address of ethernet card gateway (maybe 10.1.1.254?)>

You may also need to add additional routes for the other RFC 1918 IP address ranges.

As you mentioned, putting these manual routes in will probably cause you problems if you move your machine around a lot. This configuration should allow things to route correctly though. You could maybe use a couple of batch files to automate the adding and removing of these settings.

A couple of additional thoughts:

  • Do not use the Windows "Bridge Connections" feature in network settings. This can do really bad things.
  • You may be violating company security policies by having multiple network connections since this is likely bypassing corporate firewalls and such. Make sure your not setting yourself up for trouble.
  • Even if company policy doesn't prevent you from doing this, be careful since you are creating a touch point between and internal and external networks -- nasty things may try and take advantage of this connection.
Peter
  • 5,453
  • 1
  • 26
  • 32
0

If you have access to the DHCP server on the local lan, try telling it not to issue you a default gateway, by removing the option altogether (not sure if this is possible on windows) or, as a horrible hack, make it issue the gateway address of your wireless interface.

It is also likely that DNS servers may cause problems. Make sure the DHCP server does not defaults to the AD controller as a DNS server, remove the DNS server option altogether, or configure it to issue the DNS of your wireless interface too.

b0fh
  • 3,313
  • 1
  • 21
  • 32
  • If you want an Active Directory domain to work, you nedd to make sure domain computers actually **use** the domain DNS server(s). The opposite is the single worst error you can do in an AD environment. – Massimo Feb 18 '10 at 06:30
  • But then you need the domain NS to be able to resolve queries for the outside, and have access to the external world, which may not be desirable in this case (otherwise why use a dual connection ? just set up a permanent gateway on the lab network and use it) – b0fh Feb 18 '10 at 10:47