Score:0

Add-VpnConnectionRoute does not allow to add a reoute to a VPN connection

ms flag

I have Windows 10 Pro.

I connected to a VPN using FortiNet.

My local network addresses are 192.168.0.x and the VPN assigned the IP 172.20.21.3 to my PC.

The problem is that I need to access the IP 192.168.21y.x that is present in the remote network.

When I connect to a virtual machine (Windows Server) in the network where the VM belongs to I can ping to 192.168.21y.x with no problems, however, when I try to ping from my PC, that IP is not reachable.

I tried adding the following route using Windows PowerShell:

Add-VpnConnectionRoute -ConnectionName 'Ethernet 3' -DestinationPrefix 192.168.21y.x/8

But I get this error:

Add-VpnConnectionRoute : Invalid parameter DestinationPrefix 192.168.21y.x/8. : El parámetro no es correcto. En línea: 1 Carácter: 1

  • Add-VpnConnectionRoute -ConnectionName 'Ethernet 3' -DestinationPrefi ...
  •   + CategoryInfo          : InvalidArgument: (Ethernet 3:root/Microsoft/...ConnectionRoute) [Add-VpnConnectionRoute]    ,
    

CimException + FullyQualifiedErrorId : WIN32 87,Add-VpnConnectionRoute

Which means that "Parameter is incorrect"

I also tried with:

Add-VpnConnectionRoute -ConnectionName "Ethernet 3" -DestinationPrefix "192.168.21y.x/24"

But this other error was shown instead:

Add-VpnConnectionRoute : The configuration cannot be applied to the local user VPN connection Ethernet 3. : El sistema no pudo encontrar la entrada de la libreta de teléfonos para esta conexión. En línea: 1 Carácter: 1

  • Add-VpnConnectionRoute -ConnectionName "Ethernet 3" -DestinationPrefi ...
  •   + CategoryInfo          : ObjectNotFound: (Ethernet 3:root/Microsoft/...ConnectionRoute) [Add-VpnConnectionRoute],
    

CimException + FullyQualifiedErrorId : VPN 623,Add-VpnConnectionRoute

Which means that the system could not find the entry of the phone book for this connection.

How can I do it?

Thanks

Score:1
za flag

Add-VpnConnectionRoute is a cmdlet that associates the route with VPN profile and installs it into a FIB as soon as this VPN connection is up.

Since your VPN profile probably cannot be named Ethernet 3 and this is clearly a wired connection profile, you're merely doing something weird, stupid and/or hilarious.

Looks like powershell agrees with me.

Jaime avatar
ms flag
Ethernet 3 is the ethernet connection associated with the VPN. Isn't this what I should use in the call to `Add-VpnConnectionRoute`
I sit in a Tesla and translated this thread with Ai:

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.