0

I have two network cards listed here with the route print command:

Interface List
29...10 fe ed 02 d9 8e ......Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC (NDIS 6.20) #2
24...00 14 d1 2a 4d a4 ......Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC (NDIS 6.20)

Here are the IP ranges of the two networks:

Network A - 10.160.*.*
Network B - 10.220.*.*

Network A is physically connected to #29 in the interface list and Network B is connected to #24.

Currently I can only access Network B. What would be route add command be so that I can access both networks? Is it possible to make this change persist after restarting?

Here is a very similar question: Can I connect to two networks simultaneously with two Ethernet cards?, but it relates to Linux and not Windows.

2
  • route add -p xx.xx.xx.xx will make a static route persistent through boots. I don't know enough details about your setup but are you aware that Windows can route 2 different networks when routing functionality is enabled in the registry?
    – nixda
    Dec 3, 2013 at 17:38
  • I can answer any question about my network setup. I added the registry entry and it has no effect, perhaps it only works with windows server (I'm running windows 7 ultimate).
    – keyoh
    Dec 4, 2013 at 16:59

3 Answers 3

1

The two networks you describe in your question are configured as Class B networks because there are two "wildcard" octets.

Network A - 10.160.*.* == 10.160.0.0/16
Network B - 10.220.*.* == 10.220.0.0/16

Note that both of these spaces as described require the use of the subnet mask /16 (a.k.a. 255.255.0.0) in order to reach the entire space.

However, you describe your subnet masks as set to /24 (a.k.a. 255.255.255.0). If there are actually hosts in the entire /16 area, your machine will not be able to access them directly. Instead, it will only be able to access machines that share the same 3rd octet in addition to the first two.

In your example, with the gateways set to 10.160.123.1 and 10.220.250.1, you will not be able to directly access any hosts in the blocks 10.160.0.0 - 10.160.122.255, 10.160.124.0 - 10.160.255.255, 10.220.0.0 - 10.220.249.255, and 10.220.251.0 - 10.220.255.255. Instead, traffic to any of these addresses will go to one of your gateways, whichever happens to be the primary.

If your networks really are Class B, you need to change the Subnet Mask entries on your computer to match the required 255.255.0.0 mask for a Class B network. If your networks are actually smaller, you may need to set explicit routes, as others have described.

An easy way to check if the problem is routing is to unplug whichever connection is currently working and see if the other one starts to work. Note that you may need to clear routes from the routing table, so view it with route print and delete anything that doesn't belong with route delete [destination].

1
  • Changing the subnet mask to 255.255.0.0 did the trick.
    – keyoh
    Mar 4, 2014 at 18:37
1

You don't need to add a route, since you are already part of the network (that is, if you have an address in each network.)

There is no real way of setting a "default route". Windows will use the route which responds first. In the case that you try to access 10.160.0.0/16, it will use the route which goes to 10.160.0.1 (the gateway, normally), since that is what will respond first, seeing as the gateway for 10.220.0.1 will not respond at all.

For example, I have my network set up so that I have an address in the following subnets on my workstation:

  • 192.168.1.0/24
  • 192.168.74.0/24

I am able to access a server at 192.168.74.10, or a server at 192.168.1.70, without doing anything apart from having my network card set up with an address on each network.

Do you have a gateway set on each NIC? or just one of them?

2
  • The gateways is set on each NIC. 10.220.250.1 and 10.160.123.1
    – keyoh
    Dec 9, 2013 at 21:25
  • If that is the case, you should be able to access 10.220.250.0/24 and 10.160.123.0/24, unless there is some kind of restriction in place elsewhere. If you've set up your network cards, that is all you have to do in order to be able to 'talk' to two different network ranges. Dec 10, 2013 at 4:46
0

The NIC for network A, has it been configured to have a valid network A IP address? Once it does you will be able to connect. You can do this with a single NIC as well via secondary IP address's.

5
  • The nic card for network A is configured with a valid network A IP address. My understanding is that windows will default all network traffic through a primary network card when multiple ones are detected. Routes need to be added to specify which traffic goes to a secondary network card.
    – keyoh
    Nov 27, 2013 at 23:21
  • @keyoh which subnet mask are you using?
    – AndreaCi
    Dec 3, 2013 at 17:35
  • @AndreaCi 255.255.255.0
    – keyoh
    Dec 3, 2013 at 21:16
  • If you have a valid network address in Network A then you should be able to reach a host in it by ping for example. Use tracert to validate whether it is going direct to the host in Network A, or going via the default gateway in Network B (assuming of course that the default gateway is not set up as transparent). What is the subnet for Network B? If it is larger than 255.255.0.0 then traffic for Network A will be sent to the NIC for Network B.
    – dunxd
    Dec 9, 2013 at 13:23
  • @keyoh, Windows will send any local network traffic out the appropriate interface without any static routes. Only traffic that is not on a local subnet will go out through what Windows determines is the "primary" network card's gateway. If you have added static routes incorrectly, this could be creating your problem.
    – YLearn
    Dec 10, 2013 at 5:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .