Share via


route print and route add not working for me.

Question

Wednesday, May 1, 2019 1:42 AM

Hi,

I asked this in the General Server forums... But I think it belongs here.
I'm trying to resolve the problem of not being able to have 2 interfaces enabled at the same time without having to shut one down to force traffic to that particular interface.
Let me explain further:
I have network 172.16.0.0 255.240.0.0 on interface #7 and network 192.168.1.0 255.255.255.0 on interface #4.
I want to send traffic going to 172.16.yy.1 out through interface #7 and traffic bound for 192.168.1.97 going to interface #4.
However, I'm having a few problems (see below for log of commands and their results).

  1. the route add command: route add 172.16.0.0 mask 255.240.0.0 172.16.yy.1 metric 1 if 7
    doesn't work.  Not only does it not work.  It doesn't show up in route print (See below)
    I didn't issue any other commands because the default static route should be fine for all other traffic.
    Could someone help me?
    Thank you,
    John
    P.S. I got the mask wrong for the first route add command... So I issued it again at again with the correct mask and put this at the bottom of the log after the initial log.
    Microsoft Windows [Version 10.0.17134.523]
    (c) 2018 Microsoft Corporation. All rights reserved.
    C:\Windows\system32>route print
    ===========================================================================
    Interface List
     20...yy yy yy yy yy yy ......Intel(R) Gigabit ET Quad Port Server Adapter
     16...yy yy yy yy yy yy ......Intel(R) Gigabit ET Quad Port Server Adapter #3
     18...yy yy yy yy yy yy ......Intel(R) Ethernet Connection (7) I219-V
     10...yy yy yy yy yy yy ......Intel(R) Wireless-AC 9560
     29...yy yy yy yy yy yy ......Microsoft Wi-Fi Direct Virtual Adapter
     30...yy yy yy yy yy yy ......Intel(R) Gigabit ET Quad Port Server Adapter #4
      1...........................Software Loopback Interface 1
      3...yy yy yy yy yy yy ......Hyper-V Virtual Ethernet Adapter #3
    ===========================================================================
    IPv4 Route Table
    ===========================================================================
    Active Routes:
    Network Destination        Netmask          Gateway       Interface  Metric
              0.0.0.0          0.0.0.0     192.168.1.yy     192.168.1.yy 35
            127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
            127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
      127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
       172.26.188.240  255.255.255.240         On-link    172.26.188.241   5256
       172.26.188.241  255.255.255.255         On-link    172.26.188.241   5256
       172.26.188.255  255.255.255.255         On-link    172.26.188.241   5256
          192.168.1.0    255.255.255.0         On-link      192.168.1.yy   291
         192.168.1.yy 255.255.255.255         On-link      192.168.1.yy 291
        192.168.1.255  255.255.255.255         On-link      192.168.1.yy 291
            224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
            224.0.0.0        240.0.0.0         On-link    172.26.188.241   5256
            224.0.0.0        240.0.0.0         On-link      192.168.1.yy 291
      255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
      255.255.255.255  255.255.255.255         On-link    172.26.188.241   5256
      255.255.255.255  255.255.255.255         On-link      192.168.1.yy 291
    ===========================================================================
    Persistent Routes:
      None
    IPv6 Route Table
    ===========================================================================
    Active Routes:
     If Metric Network Destination      Gateway
      1    331 ::1/128                  On-link
      3   5256 ipv6Addr/64                On-link
      3   5256 ipv6Addr/128
                                        On-link
      1    331 ff00::/8                 On-link
      3   5256 ff00::/8                 On-link
    ===========================================================================
    Persistent Routes:
      None
    C:\Windows\system32>route delete 0.0.0.0
     OK!
    C:\Windows\system32>route add 0.0.0.0 mask 0.0.0.0 192.168.1.yy metric 10000 if 192.168.1.yy
    route: bad metric value 10000
    C:\Windows\system32>route add 0.0.0.0 mask 0.0.0.0 192.168.1.yy metric 6000 if 192.168.1.yy
    The route addition failed: The system cannot find the file specified.

C:\Windows\system32>route add 0.0.0.0 mask 0.0.0.0 192.168.1.yy metric 6000 if 30  OK! C:\Windows\system32>route print

Interface List  20...00 yy yy yy yy yy ......Intel(R) Gigabit ET  16...yy yy yy yy yy yy ......Intel(R) Gigabit ET  18...yy yy yy yy yy yy ......Intel(R) Ethernet Connection (7) I219-V  10...yy yy yy yy yy yy ......Intel(R) Wireless  29...yy yy yy yy yy yy ......Microsoft Wi-Fi Direct Virtual Adapter   6...yy yy yy yy yy yy ......Microsoft Wi-Fi Direct Virtual Adapter #2  30...yy yy yy yy yy yy ......Intel(R) Gigabit ET Quad Port Server Adapter #4   1...........................Software Loopback Interface 1   3...yy yy yy yy yy yy ......Hyper-V Virtual Ethernet Adapter #3

IPv4 Route Table

Active Routes: Network Destination        Netmask          Gateway       Interface  Metric           0.0.0.0          0.0.0.0     192.168.1.yy     192.168.1.yy  6035         127.0.0.0        255.0.0.0         On-link         127.0.0.1    331         127.0.0.1  255.255.255.255         On-link         127.0.0.1    331   127.255.255.255  255.255.255.255         On-link         127.0.0.1    331    172.26.188.240  255.255.255.240         On-link    172.26.188.241   5256    172.26.188.241  255.255.255.255         On-link    172.26.188.241   5256    172.26.188.255  255.255.255.255         On-link    172.26.188.241   5256       192.168.1.0    255.255.255.0         On-link      192.168.1.yy   291      192.168.1.yy 255.255.255.255         On-link      192.168.1.yy   291     192.168.1.255  255.255.255.255         On-link      192.168.1.yy   291         224.0.0.0        240.0.0.0         On-link         127.0.0.1    331         224.0.0.0        240.0.0.0         On-link    172.26.188.241   5256         224.0.0.0        240.0.0.0         On-link      192.168.1.yy   291   255.255.255.255  255.255.255.255         On-link         127.0.0.1    331   255.255.255.255  255.255.255.255         On-link    172.26.188.241   5256   255.255.255.255  255.255.255.255         On-link      192.168.1.yy   291

Persistent Routes:   None IPv6 Route Table

Active Routes:  If Metric Network Destination      Gateway   1    331 ::1/128                  On-link   3   5256 ipv6Addr/64                On-link   3   5256 ipv6Addr/128                                     On-link   1    331 ff00::/8                 On-link   3   5256 ff00::/8                 On-link

Persistent Routes:   None C:\Windows\system32>route add 172.16.0.0 mask 255.255.0.0 172.16.yy.yy metric 35 if 18  OK! C:\Windows\system32>route print

Interface List  20...yy yy yy yy yy yy ......Intel(R) Gigabit ET Quad Port Server Adapter  16...yy yy yy yy yy yy ......Intel(R) Gigabit ET Quad Port Server Adapter #3  18...yy yy yy yy yy yy ......Intel(R) Ethernet Connection (7) I219-V  10...yy yy yy yy yy yy ......Intel(R) Wireless-AC 9560  29...yy yy yy yy yy yy ......Microsoft Wi-Fi Direct Virtual Adapter   6...yy yy yy yy yy yy ......Microsoft Wi-Fi Direct Virtual Adapter #2  30...yy yy yy yy yy yy ......Intel(R) Gigabit ET Quad Port Server Adapter #4   1...........................Software Loopback Interface 1   3...yy yy yy yy yy yy ......Hyper-V Virtual Ethernet Adapter #3

IPv4 Route Table

Active Routes: Network Destination        Netmask          Gateway       Interface  Metric           0.0.0.0          0.0.0.0     192.168.1.yy     192.168.1.yy  6035         127.0.0.0        255.0.0.0         On-link         127.0.0.1    331         127.0.0.1  255.255.255.255         On-link         127.0.0.1    331   127.255.255.255  255.255.255.255         On-link         127.0.0.1    331    172.26.188.240  255.255.255.240         On-link    172.26.188.241   5256    172.26.188.241  255.255.255.255         On-link    172.26.188.241   5256    172.26.188.255  255.255.255.255         On-link    172.26.188.241   5256       192.168.1.0    255.255.255.0         On-link      192.168.1.yy   291      192.168.1.yy 255.255.255.255         On-link      192.168.1.yy   291     192.168.1.255  255.255.255.255         On-link      192.168.1.yy   291         224.0.0.0        240.0.0.0         On-link         127.0.0.1    331         224.0.0.0        240.0.0.0         On-link    172.26.188.241   5256         224.0.0.0        240.0.0.0         On-link      192.168.1.yy   291   255.255.255.255  255.255.255.255         On-link         127.0.0.1    331   255.255.255.255  255.255.255.255         On-link    172.26.188.241   5256   255.255.255.255  255.255.255.255         On-link      192.168.1.yy   291

Persistent Routes:   None IPv6 Route Table

Active Routes:  If Metric Network Destination      Gateway   1    331 ::1/128                  On-link   3   5256 ipv6Addr/64                On-link   3   5256 ipv6Addr/128                                     On-link   1    331 ff00::/8                 On-link   3   5256 ff00::/8                 On-link

Persistent Routes:
  None
C:\Windows\system32>ping 172.16.yy.yy
Pinging 172.16.yy.yy with 32 bytes of data:
Request timed out.
Ping statistics for 172.16.yy.yy:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),
Control-C
^C
C:\Windows\system32>ping 172.16.yy.yy
Pinging 172.16.yy.yy with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 172.16.yy.yy:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:\Windows\system32>

C:\Windows\system32>route add 172.16.0.0 mask 255.240.0.0 172.16.yy.yy metric 1 if 18  OK! C:\Windows\system32>ping 172.16.yy.yy Pinging 172.16.yy.yy with 32 bytes of data: Request timed out. Ping statistics for 172.16.yy.yy:     Packets: Sent = 1, Received = 0, Lost = 1 (100% loss), Control-C ^C C:\Windows\system32>route print

Interface List  20...yy yy yy yy yy yy ......Intel(R) Gigabit ET Quad Port Server Adapter  16...yy yy yy yy yy yy ......Intel(R) Gigabit ET Quad Port Server Adapter #3  18...yy yy yy yy yy yy ......Intel(R) Ethernet Connection (7) I219-V  10...yy yy yy yy yy yy ......Intel(R) Wireless-AC 9560  29...yy yy yy yy yy yy ......Microsoft Wi-Fi Direct Virtual Adapter   6...yy yy yy yy yy yy ......Microsoft Wi-Fi Direct Virtual Adapter #2  30...yy yy yy yy yy yy ......Intel(R) Gigabit ET Quad Port Server Adapter #4   1...........................Software Loopback Interface 1   3...yy yy yy yy yy yy ......Hyper-V Virtual Ethernet Adapter #3

IPv4 Route Table

Active Routes: Network Destination        Netmask          Gateway       Interface  Metric           0.0.0.0          0.0.0.0     192.168.1.yy     192.168.1.yy  6035         127.0.0.0        255.0.0.0         On-link         127.0.0.1    331         127.0.0.1  255.255.255.255         On-link         127.0.0.1    331   127.255.255.255  255.255.255.255         On-link         127.0.0.1    331    172.26.188.240  255.255.255.240         On-link    172.26.188.241   5256    172.26.188.241  255.255.255.255         On-link    172.26.188.241   5256    172.26.188.255  255.255.255.255         On-link    172.26.188.241   5256       192.168.1.0    255.255.255.0         On-link      192.168.1.yy   291      192.168.1.yy 255.255.255.255         On-link      192.168.1.yy   291     192.168.1.255  255.255.255.255         On-link      192.168.1.yy   291         224.0.0.0        240.0.0.0         On-link         127.0.0.1    331         224.0.0.0        240.0.0.0         On-link    172.26.188.241   5256         224.0.0.0        240.0.0.0         On-link      192.168.1.yy   291   255.255.255.255  255.255.255.255         On-link         127.0.0.1    331   255.255.255.255  255.255.255.255         On-link    172.26.188.241   5256   255.255.255.255  255.255.255.255         On-link      192.168.1.yy   291

Persistent Routes:   None IPv6 Route Table

Active Routes:  If Metric Network Destination      Gateway   1    331 ::1/128                  On-link   3   5256 ipv6Addr/64                On-link   3   5256 ipv6Addr/128                                     On-link   1    331 ff00::/8                 On-link   3   5256 ff00::/8                 On-link

Persistent Routes:
  None
C:\Windows\system32>

All replies (10)

Friday, May 3, 2019 7:50 AM âś…Answered

 I don't know what is going on here. If you have an active interface with a 172.16 IP address and a default gateway set, the route should be created automatically. You do not need to do anything.

 Pleas supply the output of an ipconfig /all command.

Bill

  To add the route manually, do not give the interface a default gateway. Add the route using the command route add 172.16.41.0 mask 255.255.255.0 172.16.41.7 metric 25

 Note that when you add the route for a specific subnet (in your case 172.16.41.0/24) the OS will create the bundled route for the subnet 172.16.0.0/16 automatically.


Wednesday, May 1, 2019 5:56 AM

your first sentence normally would prevent me from answering your question,
but that you post your usage of route add with random parameters proves that you have humour.
*     route add 0.0.0.0 mask 0.0.0.0 192.168.1.98 metric 6000 if 192.168.1.17*
*     The route addition failed: The system cannot find the file specified.*

One of the parameters to "route add" is the gateway address.


Wednesday, May 1, 2019 6:26 AM

Hi,

*I have network 172.16.0.0 255.240.0.0 on interface #7 and network 192.168.1.0 255.255.255.0 on interface #4. *

Do you mean that there are two interfaces #7 and #4 on the same computer? But I don't see the interface #7 in the route table.

Meanwhile, I find that there are so many interfaces in the route table.

Best regards,

Travis

Please remember to mark the replies as an answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected]


Wednesday, May 1, 2019 3:09 PM

Please excuse my frustration with Microsoft Products. 

I just plain can't get them to work sometimes.  Sorry also for putting "random parameters" in the route add command as I'm not perfect and don't always get the command parameters right all the time.  Luckily, Microsoft (in this case) has given relatively decent error information to steer me in the correct direction.

Unfortunately, even after the command gives the response "OK!" it seems to not work.

Thank you for your response. I realized it was risky to joke about such a high profile person and project, but... I think at this point, the technical information listed, and previous frustrations have warranted it.

My limited experience in business aside, it seems from past releases of Microsoft that consumers don't get what they paid for, they get what the highest bidder paid for.  However, I think that's a topic for another thread.

Thanks again,

John


Wednesday, May 1, 2019 3:14 PM

Interface 7 is listed as 18 in the interface table it actually has a (7) in the name/description.

The ip address of this interface is in the 172.16.0.0 255.240.0.0 network.  (I may have reset the interface a couple of times and it got different IP Addresses somehow.  But they're all within the specified network range.)

One reason that there are so many interfaces is that I have a multi-port NIC in my computer.  The other is that some of those interfaces are for VMs.

John


Wednesday, May 1, 2019 3:16 PM

In order to get more eyeballs on this issue and possibly more responses, I have taken out the sentence you find so humorous (and that I do too after being in a better mood.)

John


Thursday, May 2, 2019 7:41 AM

Hi,

I didn't see subnet 172.16.0.0 in the route table. 

Can you add a route to the 192.168.1.0 subnet?

Best regards,

Travis

Please remember to mark the replies as an answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected]


Thursday, May 2, 2019 2:00 PM

I'm trying to add that route (172.16.0.0 255.240.0.0) and it doesn't work.  That's one of my problems.  It doesn't work (send traffic to the correct interface/gateway) and it doesn't show in the route print command. 

In any case, the route 192.168.1.0 is in there.  It goes out interface 192.168.1.17.

Also, the default route should cover things as it goes to my gateway.

So, I'm not sure what the goal of trying to add that route is, but it seems to me that you should not need to add another route in there.

John


Saturday, May 4, 2019 1:33 PM

Hi!

It works!  Thank you so much!  All's well that ends well, right?

I just added an interface and the routes are being added correctly now.  I didn't have to turn off all other interfaces to force traffic to the interface I wanted.  I also didn't need to add another route to try to re-direct traffic.  They both just work.

No need to do an ipconfig /all now, since I've already given quite a bit of my network information out.  (I'm probably going to redact the ips/macs now from my previous posts... Hope you don't mind.

Thanks again.

John Byrne


Saturday, May 4, 2019 4:10 PM

So it was not Microsoft's fault after all?