• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 479
  • Last Modified:

Route only internet traffice to NIC 2

I have a pc with 2 network cards that's connected to the company's LAN with NIC 1.
NIC 2 is connected to a regular adsl modem.

What I want is all internet traffic to travel though NIC 2.

I can only get this working by disabling NIC 1, but I want to keep using both networks.
Is there any routing rule I can apply to direct only internet traffice to NIC2 ?

  • 2
  • 2
2 Solutions
Type "route print" i command mode. you will get a screen as something like below.

Interface List
0x1 ........................... Broadcam Net01
0x2 ...00 14 22 4d 41 a2 ...... Broadcom NetXtreme 57xx Gigabit Controller - Pac
ket Scheduler Miniport

Note down the NIC connected to your office network. For eg: 0x1 here.

Then you should be aware of the intranet IP range for eg 10.* or 172.168.* so based on that add use route add command as below syntax.

route ADD MASK IF 1

This means that traffic for the IPs starting from 157.* with Subnet mask will go through gateway.

For this to work make your NIC2 connected to internet as your default Ethernet network cad.

This will go off once u log off from the system so to make it work make a batch file and put it in the startup. so that no need of manual work need to be done.

You must put the default route to NIC2, and add specific routes to NIC1 for you LANs networks.
On windows, you can do it by DOS command : route add ...
see route add /? to have parameters.
the command for default route : route add MASK addrNIC2  IF n
where n is the ID of the NIC2 interface. Yoy get it by command  : route print
karstiemanAuthor Commented:
Thanks guys, I've got it working now !
@ Ghousullah: how can I change the default network card from a batch file ? ( I know how to add the routes )
karstiemanAuthor Commented:
Thanks guys, I got it working now !
I think you would not need to make it through Batch file. As windows will have the settings stored to your profile as your NIC2 as default once you make it through the Control panel window.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now