tags:

views:

593

answers:

4

In Windows XP:

How do you direct traffic to/from a particular site to a specific NIC?

For Instance: How do I say, all connections to stackoverflow.com should use my wireless connection, while all other sites will use my ethernet?

+1  A: 

you should be able to do it using the route command. Route add (ip address) (netmask) (gateway) metric 1

Danimal
Can you please give an example using the stackoverflow example above
mrbradleyt
+1  A: 

I'm not sure if there's an easier way, but one way would be to add a route to the IP(s) of stackoverflow.com that explicitly specifies your wireless connection, using a lower metric (cost) than your default route.

Running nslookup www.stackoverflow.com shows only one IP: 67.199.15.132, so the syntax would be:

route -p add 67.199.15.132 [your wireless gateway] metric [lower metric than default route] IF [wireless interface]

See the route command for more info.

Jonathan
Is There anyway to determine all the IP's that a particular domain could use?
mrbradleyt
nslookup will return the full list of IPs that DNS returns right now. There's no guaratee those won't be changed 5 minutes later though. And no, you can't use hostnames in routes.
Jonathan
+1  A: 

Modify your routing table so that specific hosts go through the desired interface.

You need to have a 'default' route, which would either be your ethernet or wireless. But to direct traffic through the other interface, use the command line 'route' command to add a route to the specific IP address you're wanting to redirect.

For example, stackoverflow.com has the IP address 67.199.15.132 (you can find this by using nslookup or pinging it). Issue a route add 67.199.15.132 mask 255.255.255.255 a.b.c.d IF e where a.b.c.d == the IP address of the router on the other end of your wireless interface, and e is the interface number (a 'route print' command will list each interface and it's interface number).

If you add the '-p' flag to the route command the route will be persistent between reboots.

Steve Moon
+1  A: 

Hi There,

Within XP, I have often found that by adding/modifying static routes, I can typically accomplish what I need in such cases.

Of course, there are other 'high level' COTS tools/firewalls that might provide you a better interface.

One caveat with modifying routes - VPN tunnels are not too happy about chnages in static routes once the VPN is set up so be sure to set it up at Windows boot up after the NICs are initialized through some scripting.

Static routes- these will work fine, unless you are using a VPN tunnel.

Windows 'route' help

Manipulates network routing tables.

ROUTE [-f] [-p] [command [destination] [MASK netmask] [gateway] [METRIC metric] [IF interface]

-f Clears the routing tables of all gateway entries. If this is used in conjunction with one of the commands, the tables are cleared prior to running the command. -p When used with the ADD command, makes a route persistent across boots of the system. By default, routes are not preserved when the system is restarted. Ignored for all other commands, which always affect the appropriate persistent routes. This option is not supported in Windows 95. command One of these: PRINT Prints a route ADD Adds a route DELETE Deletes a route CHANGE Modifies an existing route

Jay