How to add a static route to force specific traffic to go through a specific NIC

route -p add 10.152.212.0 mask 255.255.255.0 10.224.5.1

This will permanently (-p) add a static route so that any request going to an IP in the 10.152.212.0/24 (255.255.255.0) network goes through the network gateway 10.224.5.1 of the other network card

In case you need only one specifc IP, use the exact IP instead of 10.152.212.0 and change the mask to 255.255.255.255 or remove it completely, e.g.

route -p add 10.152.212.5 mask 255.255.255.255 10.224.5.1

Notes:

  • To delete a route, use the command route delete
  • To avoid making it permanent, remove the -p

That’s it, Enjoy!

Sources:

https://www.howtogeek.com/22/adding-a-tcpip-route-to-the-windows-routing-table/

About SoCRaT

Systems Engineer, OSS & Linux Geek
This entry was posted in Windows and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s