Sunday, January 23, 2011

Two NIC cards with the same metric - Internet traffic going out the wrong one

I have two NIC cards in my computer - one is connected to our corporate network and the Internet, the other is connected to a private LAN through a Linksys WRT54G. Both cards use DHCP.

This was never an issue with Windows XP, but with Windows Vista (and Windows 7) the metric for the 0.0.0.0 route is the same (20), and it appears that some network traffic that should go out my main network card are going out my secondary card instead.

The solution to date is to delete the 0.0.0.0 route associated with the second NIC card, but I have to do this several times a day.

Is there a better solution?

--Bruce

  • Yes. You can override the automatic metric calculation in the Advanced settings of the TCP/IP properties of each card. Use this to set which NIC you want to be preferred.

  • Do both cards use the same subnet or something? You say they both networks use DHCP, they really should be using different private ranges, otherwise you have a nonsensical network setup, if both cards have addresses in the same subnet then the machine will correctly assume they are the same network. If both networks use the same subnet the solution is to change the subnet one of the routers issues address in rather than butchering your network config. There are hundreds of private subnets to choose from after all.

    From Bart B
  • You probaly have to delete that route several times a day because your dhcp lease on the card that usually has the default route is for about 2 or 3 hours???

    I used to have a server with 2 network cards, one had a public ip address that can be contacted from the internet and the other card was plugged into the internal network. I found that every 2 hours, when the dhcp lease was renewed on the internal network card, it could change the routing i had set up until i started using "-p" at the end of the command which makes the routing permanent and you wont loose them not even after restarting.

    example: route add x.x.x.0 mask x.x.x.0 192.168.1.1 -p

    From Nico
  • Well ive had the same sort of problem as described but on windows XP, and it was solved by the automatic metric calculation answered, thanks kevin

    I will explain my setup and exactly how I solved it. My computer is connected to two networks, the first is a wifi card to a router for internet access, the second is by a wired network card attached to a hub. a temporary meassure put in place so I can configure a NAS box also attached to the hub.

    My predicament - not being able to not browse the intruction manual online whilst I configure the NAS box through its own web based interface! I set up the following subnets

    192.168.100.1 - wired to the NAS box through a hub

    192.168.200.1 - wifi to the internet through a router

    The effect was strange, sometimes I could browse a page other times it would just time out, clearly internet traffic was getting lost down the wrong subnet.

    Heres how to fix it..

    Open up a command prompt and type 'route print', you can then verfiy the 'metric' for each subnet your running, look at the lines where the Netmask shows as 0.0.0.0, take a note of the metrics, the wired network will most likely be '20' and the wireless '25', note: the lower value tells your computer to use to use that subnet over the other, certainly in the case of web browsing.

    Go ... Start menu > Control Panel > Network Connections > Open the Properties of the non-internet network > under the 'general' tab and from within the 'This connection uses the following items' list, select 'Internet Protocol (TCIP/IP)' and click the 'Properites' button > From under the 'General' tab click the 'Advanced' button > under the 'IP Settings' tab untick the 'Automatic metric' box and input into the 'Interface Metric:' field the higher of the two values collected from the 'route print' command.

    Repeat again for the internet enabled subnet, but this time entering the lower value, you can then verify the settings by going back and running the 'route print' command again.

    Hope the intructions helps somebody

    From mark

0 comments:

Post a Comment