Windows Route traffic to specific IP through secondary nic
Set the IP on your second NIC to one on the same network as your second machine - i.e. 200.200.200.201 - and it will use that interface automatically. Don't use the 192.168.100.10, it adds unnecessary complications.
Related videos on Youtube
![Agustin Garzon](https://i.stack.imgur.com/7dwAH.jpg?s=256&g=1)
Comments
-
Agustin Garzon almost 2 years
Being reading about this on ServerFault but decided to open a new question, as I can't re-ask over existing threads.
2 computers, 2 nics: Computer A - 100.100.100.10 - 192.168.100.10 Computer B - 100.100.100.20 - 192.168.100.20
I need to set a windows route, so traffic on computer A targeting ip 100.100.100.20 use the secondary nic.
Been here: How do I route traffic to a specific site/IP-block through one nic, with other traffic through another nic? And here: DFS Replication on Lan (with multiple subnets)
I want to make sure I'm not setting the route the wrong way: route add 100.100.100.20 mask 255.255.255.255 192.168.100.10
I'm trying this so some processes can get to the second computer using the faster link. Which would also reduce load on the primary nic.
These processes (such as dfsr, backup, etc.) do not allow you to specify the IP address they are bound to, so they are using the public facing address, and the route approach makes sense.
My situation is pretty much like the second link I posted, DFSR does not let you to chose the IP it's bound to, it does so by resolving the computer name within a domain. Same with other processes we need to get flowing through secondary nic. So instead of having them going through the 100mb nic at 100.100.100.10, we want to route them through the 1000mb nic 192.168.100.10. At least that's the logic :)
-
Felix Frank about 10 yearsHi, so am I right to assume that this doesn't work and your question is why?
-
Agustin Garzon about 10 yearsTrying to avoid the guess work and minimize the amount of tests. Want to see if my logic is OK, and if the syntax for the route is OK or it is missing something. Doing it the wrong way will cripple a server and need to minimize the downtime.
-
Felix Frank about 10 yearsShouldn't that be
route add 100.100.100.20 mask 255.255.255.255 192.168.100.20
, i.e. try to reachB
viaB
's secondary address?
-
-
Agustin Garzon about 10 yearsThe second nic on the first machine is on the same lan network as the second machine, it's 192.168.100.10 on left and 192.168.100.20 on right. Even if I do what you suggest, setting it to 200.200.200.201 wouldn't work as traffic would keep flowing through nic 1 on 200.200.200.200.
-
John about 10 yearsThat doesn't add up right for me... can you maybe draw a picture of your network setup and post it somewhere we (I) can see what's going on?
-
joeqwerty about 10 years@AgustinGarzon - That doesn't make any sense. Where is the machine with ip address 200.200.200.200? Why are you creating a route to 200.200.200.200. if the traffic is destined for 192.168.100.20?
-
Agustin Garzon about 10 yearsUsing 200.200.200.200 was my bad, I corrected the IP address I was using in my example and added a drawing in case that helps. Thanks for taking a look :)
-
Massimo about 10 yearsOk, see edit then.
-
Dusan Bajic about 10 yearsDid you try Evan's suggestion from the second link you posted?
-
Agustin Garzon about 10 yearsI took Evan's suggestion, which is the route-add syntax in my post, but I did not run it just yet, as I want to make sure I'm not doing it wrong. Massimo is saying this will not work so there it goes.
-
John about 10 yearsOverall, this is way too much complication - if you need more bandwidth for this application, upgrade the network the primary NICs are attached to. Otherwise, you can use the
hosts
file to fool computer B, but that will eventually cause you other problems down the road. -
Agustin Garzon about 10 yearsThe primary nics are connected to 100mb ports on a switch and our ISP is not willing to update / change that for us.
-
John about 10 yearsThen it's time to change ISPs.
-
Massimo about 10 yearsEvan's answer says that he's almost sure a static route is not going to work, and I agree with that; the only way that could work is if the two servers are configured to perform routing between their two NICs (which on Windows systems requires installing RRAS), otherwise they will simply reject any packet which enters an interface but is addressed to another one. Ugly as it may be, the
hosts
file hack is the only solution here.