Multiple-homed internet connectivity

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

I currently have two network adapters in my XP
Professional box. What I'm trying to figure out is how
Windows decides which adapter to send data through.

I know that it must use some sort of trial-and-error
system, so that if it can't find a host using one of the
adapters it will try the other one, but how does it
decide which one to use first?

I want all of my traffic, both intranet and internet, to
go through the first adapter, unless the host isn't
found, at which point it should check the other one (just
used for a LAN connection, nothing external; different IP
scheme).

Right now I'm keeping it from trying to get on the
Internet from the second card by not assigning any
gateway or DNS addresses, but this has caused a few
problems where a program will occasionally time out or
fail to connect because it's insisting trying to use the
second card instead of the first.

Thanks.
 
In your Network Settings, you'll see configurations for the 2 cards. They
each are identified differently. You could simply disable one of those
connections.
 
Ah, but if I do that then I won't have access to my
second local network, and then what's the point of having
two network cards?

The other reply to my initial post is more what I was
looking for.
 
Nick said:
I currently have two network adapters in my XP
Professional box. What I'm trying to figure out is how
Windows decides which adapter to send data through.

I know that it must use some sort of trial-and-error
system, so that if it can't find a host using one of the
adapters it will try the other one, but how does it
decide which one to use first?

I want all of my traffic, both intranet and internet, to
go through the first adapter, unless the host isn't
found, at which point it should check the other one (just
used for a LAN connection, nothing external; different IP
scheme).

Right now I'm keeping it from trying to get on the
Internet from the second card by not assigning any
gateway or DNS addresses, but this has caused a few
problems where a program will occasionally time out or
fail to connect because it's insisting trying to use the
second card instead of the first.

Thanks.


It's not trial and error.
It looks at the route table to decide where to send packets.

( from the command prompt, do a 'route print'. )

The route table is built from the following information:

1) The IP address and subnet mask assigned to each adapter:
For example, if one NIC is 192.168.0.1 / 255.255.255.0,
and the other is 192.168.1.1 /255.255.255.0, then this automatically
creates
a set of routes which tells windows that all 192.168.0.x addresses
are on the local wire out of NIC1, and all 192.168.1.x addresses
are on the local wire out of NIC2.

2) Manually created static routes.
You can manually create routes with the route add command.
For example, you can tell windows that the remote 10.0.0.2 network
is accessible via a router at 192.168.0.254 using a 'route add' command.
This works, because the 192.168.0.x network is on the local link.

3) Default routes.
The Default route ( or gateway ) is a route of last resort.
Any packets destined for a destination which does not match any
of the above is sent to the default router.

When sending a packet, IP will compare the destination to the route table.
He will attempt to find the closest match.
For example, if there's a route to that specific IP address, he'll use that.
IF not, if there's a route to a subnet containing the destination, then
he'll use that.
If there are several matching subnet routes, he'll use the most specific.
The last resort matching route is the least specific, and matches all IP
addresses.
This is the default route, and will be used if no other route matches.

If there's more than one matching route which are both as specific, then
the route metrics are compared.
The route with the lowest metric is chosen.

You'd need to give more details of your proposed configuration to
see how we can configure this.
Like a rather more complete description of the network topology and
IP addresses in use on all network segments, and the IP addresses
of any routers etc you want to use.
 
Thanks for the reply!

Really all I want to do is have ALL traffic destined for
the Internet go through adapter A, as well as any local
network traffic on the same IP class.

Right now I have two NICs in my machine and they are
setup as follows:

Adapter A: 10.0.0.x / 255.255.255.0
Adapter B: 192.168.50.x / 255.255.255.0

Like I say, the only traffic I want to use adapter B is
traffic destined for local machines on the same IP
class. Everything else should go through adapter A,
including traffic for it's local network as well as
Internet traffic.

I've got this to happen by removing the gateway and DNS
information from adapter B. The forces anything that is
not on the 192.168.50.x network to go through adapter A.

What I'd like to know is how I can tell Windows to send
all Internet related traffic through adapter A, without
removing gateway and DNS info from adapter B, assuming
it's possible.

Thanks again.
 
Back
Top