I have multiple network interfaces on a Windows client machine. I would like for some IP traffic to go through one card and other traffic to go through the other card based upon the IP (actually, I would prefer domain names) of the destination server.
I see no way to configure this using the Windows GUI.
Can I do this in WinXP+?
If it's complicated, then some pointers to good articles would be sufficient as my Googling skillz seems to fail here.
You would use the 'route' command. Essentially you can tell you machine to send traffic to different gateways based on the destination IP range. Type "route" from cmd.exe to see usage behaviours.
Here's the output from "route print" on my local machine. You can see that since I have a VPN connection with split tunneling turned on, some networks (as defined by the VPN server) are destined to the VPN (172.16.143.151) and some are destined to my local network interface (192.168.0.16)
Now, all of those are dynamic routes. You could use the route command to replicate something similar though. Try Googling "adding static routes to windows" for more details
This question is similar, no matter what platform you're on. First, I'm going to make the assumption that you have two network adapters, and they are both connected to the same subnet. If they are connected to different subnets, the answer is similar.
An approach to the problem illustrated with an example:
Routing traffic based on IP
Adapters:
10.20.100.101/24
10.20.100.102/24
10.20.100.1
Target addresses/networks and how you want to reach them:
10.20.100.201
via A110.20.100.202
via A210.20.101.0/24
via A110.20.102.0/24
via A2This means that you want to set up the following direct and gateway routes. I'm using notation similar to what you would see using
ip routes
on Linux, for simplicity:The way to make these routes exist, how to reference the appropriate adapter, and how to make them persistent is dependent upon the OS you're using. I'll describe how to do this in XP.
First, you have to identify the interface number for each interface. As described by the previous answer, use
route print
. Suppose the first few lines show:Assuming that you determined that 0x120002 was the adapter A1, and 0x120003 was adapter A2, you could then type the commands:
Using the
-p
option makes the routes persistent, which means that they will still be available after reboot.Routing traffic based on domain name
For this, I would use the same approach, but segment the domain names into different subnets to make the route entries easier. For instance, using the data above:
mynetwork1.company.localnet
=10.20.101.0/24
mynetwork2.company.localnet
=10.20.102.0/24