I have Windows Server 2012R2 with VPN Server (RRAS)
When some user connected I want setup routing to his network.
Everything work fine when I use route add, but when I use New-NetRoute routing don't works as needed.
For example (networks 192.168.110.0/24 and 192.168.111.0/24. both accessible via connection when I use route add command)
PS C:\tools> Get-NetRoute
ifIndex DestinationPrefix NextHop RouteMetric PolicyStore
------- ----------------- ------- ----------- -----------
22 192.168.111.0/24 192.168.99.199 1 ActiveStore
22 192.168.110.0/24 192.168.99.199 1 ActiveStoreRouting to network 192.168.110.0/24 was added with command
route add 192.168.110.0/24 192.168.99.199Routing to network 192.168.111.0/24 was added with command
New-NetRoute -DestinationPrefix 192.168.111.0/24 -NextHop 192.168.99.199 -PolicyStore ActiveStore -RouteMetric 1 -InterfaceIndex 22When I trying to ping host on network I receive next output:
PS C:\tools> ping 192.168.110.1 -n 1
Pinging 192.168.110.1 with 32 bytes of data:
Reply from 192.168.110.1: bytes=32 time=61ms TTL=63
Ping statistics for 192.168.110.1: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: Minimum = 61ms, Maximum = 61ms, Average = 61ms
PS C:\tools> ping 192.168.111.1 -n 1
Pinging 192.168.111.1 with 32 bytes of data:
General failure.
Ping statistics for 192.168.111.1: Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),So when I use route add I have no problems and everything works as needed, but when I use New-NetRoute I have problems with General failure error.
5 Reset to default