Score:0

New-NetRoute NextHop always set to 0.0.0.0

cn flag

I am trying to add a route on a window machine with New-Netroute and the NextHop is always being set to 0.0.0.0 rather than the value specified in the -Next parameter of the command

Expected (Works for most of us)

PS C:\WINDOWS\system32> New-NetRoute -Poli ActiveStore -InterfaceAlias "vEthernet (WSL)" -Next 172.17.155.113 -Dest 10.4.22.0/26

ifIndex DestinationPrefix                              NextHop                                  RouteMetric ifMetric PolicyStore
------- -----------------                              -------                                  ----------- -------- -----------
46      10.4.22.0/26                                   172.17.155.113                                   256 15       ActiveStore

Actual (What happens on my colleague's machine)

PS C:\WINDOWS\system32> New-NetRoute -Poli ActiveStore -InterfaceAlias "vEthernet (WSL)" -Next 172.17.155.113 -Dest 10.4.22.0/26

ifIndex DestinationPrefix                              NextHop                                  RouteMetric ifMetric PolicyStore
------- -----------------                              -------                                  ----------- -------- -----------
46      10.4.22.0/26                                   0.0.0.0                                          256 15       ActiveStore

I thought maybe it was the VPN client on her machine overwriting / managing the routes but

  1. Her vpn wasn't connected and
  2. When I connected my VPN to see if/how it interacted with my route rules I found I would simply just delete the routes immediately rather than set the NextHop to 0.0.0.0

PS C:\WINDOWS\system32> New-NetRoute -Poli ActiveStore -InterfaceAlias "vEthernet (WSL)" -Next 172.17.155.113 -Dest 10.4.22.0/26
        
ifIndex DestinationPrefix                              NextHop                                  RouteMetric ifMetric PolicyStore
------- -----------------                              -------                                  ----------- -------- -----------
46      10.4.22.0/26                                   172.17.155.113                                   256 15       ActiveStore

PS C:\WINDOWS\system32> Get-NetRoute -Dest 10.4.22.0/26
Get-NetRoute : No MSFT_NetRoute objects found with property 'DestinationPrefix' equal to '10.4.22.0/26'.  Verify the value of the property and retry.
At line:1 char:1
+ Get-NetRoute -Dest 10.4.22.0/26
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (10.4.22.0/26:String) [Get-NetRoute], CimJobException
    + FullyQualifiedErrorId : CmdletizationQuery_NotFound_DestinationPrefix,Get-NetRoute

Neither Windows nor Networking are strong points for me. What kind of things should I be checking for?

Appleoddity avatar
ng flag
Attach an `ipconfig /all` from the problematic machine. You can block out the domain names if you need to, but leave the IP info. The first thought is that the “next hop” is not reachable from this computer. Perhaps this computer has an improper subnet mask set or does not have an IP address on the same subnet as the next hop.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.