Link to home
Start Free TrialLog in
Avatar of ChrisB3127
ChrisB3127

asked on

How can I route traffic from one NIC to a specific gateway?

I am currently running Windows 2000 Server and have two NICs installed. I would like to have traffic that originates on NIC #2 be sent to a different gateway than that of NIC #1. I tried setting up the NICs with the two different default gateways. It works, but results in network timeout issues on already established connections. (For example, RDP will timeout from time to time) I read that you cannot set two different default gateways (also a warning pops up when setting the second gateway) Is there a way to have Windows direct traffic on NIC #2 to a specific gateway?
Avatar of crokeefe28
crokeefe28

you would handle this via routes:

route add "network" mask "subnetmask" "gateway"

change the quoted words to your ip addresses.  if you want to delete it:

route delete "network" mask "subnetmask"
Avatar of ChrisB3127

ASKER

Thanks for your response! Would I leave the default gateway blank in the TCP/IP configuration screen? Also would this correct the issue where I had the two gateways set (via the TCP/IP properties) and then NAT traffic would get interrupted and resulted in timeouts?
Can you explain you situation a little more?  Is this a scenario where you are sitting on the web and you have a "front side" and "back side"?  Or is this something such as a backup network?  How many networks do you need to route for?  What are the IP schemes?
I think I might've found a solution that works, let me know if this is workable.

I have a server with 2 NICs. There are 2 routers present. NIC1 goes to Router1, NIC2 goes to Router2. The local IP addresses on the NICs are 192.168.1.x with a subnet of 255.255.255.0 NIC1 has a gateway of 192.168.1.1 and NIC2's gateway is 192.168.1.2. The server is used for Email, and the Email software can "bind" itself to an IP address in the operating system. This way, when mail is from NIC1, it goes out of NIC1's gateway, and when traffic is for NIC2's IP, it goes out of NIC2's gateway. I set an "interface metric" on NIC2 to 25, so that "normal" traffic goes out of NIC1, and NIC2 would only be accessed by the Email software due to the binding setting. I ran a test, and it seems to work, and the network doesn't timeout like before, which I think is due to changing the metric on NIC2.

Please let me know if this makes sense and if you need further details.
Hmmmmm...

Well, both of your NICs are on the Same subnet, as well as your routers.....that is a problem.  You can specify multiple IP addresses to one interface (too many to count).  If you took out the second router (which as far as I can see from the brief information, is not needed at all), and you took out the second NIC, added a second IP address to the original NIC, and configured your mail server to listen on that IP with the default gateway of 192.168.1.1...your problems would be solved.  Unless that second router is doing something else other than what is explained....even if it is, you can control routing via the "router" and not Windows.  If you had to have the second router in place, you could use the above described setup, and massage the traffic via your router.....

ie:  send all traffic to the first router and place a static route to 192.168.1.2 for the traffic that you wish.  That is the way that I would go.
ASKER CERTIFIED SOLUTION
Avatar of crokeefe28
crokeefe28

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial