Ruta Estaticas en Windows Specify Route To An Interface in Windows

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Anybody can ask a question

Server Fault is a question and answer site for


system and network administrators. It only
takes a minute to sign up. Anybody can answer

Sign up to join this community


The best answers are voted up and
rise to the top

Specify route to an interface in Windows cmd


Asked 6 years, 10 months ago Modified 5 years, 5 months ago Viewed 161k times

Your privacy
By clicking “Accept all cookies”, you agree Stack Exchange
can store cookies on your device and disclose information in
accordance with our Cookie Policy.

Accept all cookies Necessary cookies only

Customize settings
I have a computer with 2 network interfaces. One interface is connected to LAN network with
IP 192.168.0.254, and the other is connected to a recorder server (192.168.0.233).
19 192.168.0.10 is the gateway for the LAN. When I try to ping to 192.168.0.6, Windows first
tries a route to the interface without network (192.168.0.233); I want to add a route to
192.168.0.6/255.255.255.0 specifing I want to use the interface 192.168.0.254 when I try to
ping 192.168.0.6. I have tried:

route add 192.168.0.6 mask 255.255.255.0 192.168.0.10 if 13

Here is a print of my interfaces:

When I add the static route to the table, it doesn't show the specified interface, only associate
it to the gateway.

Is it correct?

route windows-command-prompt interface static-routes

Share Improve this question edited Dec 11, 2016 at 8:43 asked Dec 1, 2016 at 16:33
Follow techraf Davi GN
4,273 8 29 44 193 1 1 5

Your privacy
2 Answers Sorted by: Highest score (default)
By clicking “Accept all cookies”, you agree Stack Exchange
can store cookies on your device and disclose information in
accordance with our Cookie Policy.

Accept all cookies Necessary cookies only

Customize settings
To specify the interface in windows route command, you are supposed to use 'IF'...
Uppercase letters, not lowercase.
20
Also, where you are specifying you want to add a route to a single IP 192.168.0.6, you need
to use a subnet mask of 255.255.255.255.

The subnet mask of 255.255.255.255 specifies a single host. A subnet mask of


255.255.255.0 specifies 192.168.0.X where X=1-254

So, your command should be:

route add 192.168.0.6 mask 255.255.255.255 192.168.0.10 IF 13

Looking again at your question, the best solution for you may be to use your LAN side like a
normal 192.168.0.X network... But for the recorder server, I would recommend specifying a
different network: Recorder server IP of 192.168.10.233, and then your second network
interface should be 192.168.10.2. This will eliminate the need to manually configure routes,
and may simplify everything for you.

Share Improve this answer edited Dec 1, 2016 at 18:35 answered Dec 1, 2016 at 18:10
Follow Dre
1,730 7 12

Your privacy
By clicking “Accept all cookies”, you agree Stack Exchange
can store cookies on your device and disclose information in
accordance with our Cookie Policy.

Accept all cookies Necessary cookies only

Customize settings
This should work:

11 route add 192.168.0.6 mask 255.255.255.0 192.168.0.254

If you want persistence:

route -p add 192.168.0.6 mask 255.255.255.0 192.168.0.254

Not sure what the "if" was for, but try this for cost:

route add 192.168.0.6 mask 255.255.255.0 192.168.0.254 metric 13

Share Improve this answer edited Dec 11, 2016 at 8:43 answered Dec 1, 2016 at 17:40
Follow techraf Anthony Fornito
4,273 8 29 44 9,556 1 34 124

"if" was for interface, so "IF". – Qwerty May 28 at 11:17

Your privacy
By clicking “Accept all cookies”, you agree Stack Exchange
can store cookies on your device and disclose information in
accordance with our Cookie Policy.

Accept all cookies Necessary cookies only

Customize settings

You might also like