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
- Her vpn wasn't connected and
- 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?