N
N
nordz0r2021-11-04 09:55:23
PowerShell
nordz0r, 2021-11-04 09:55:23

How to control the creation of routes based on classes through powershell?

Good afternoon. I'm using powershell to create VPN connections for users.
You can uncheck the default route using SplitTunneling, but what about class-based routes?

Add-VpnConnection -Name $VPNServer -ServerAddress $VPNServer -AuthenticationMethod Eap -RememberCredential -SplitTunneling -TunnelType Ikev2 -PassThru
Add-VpnConnectionRoute -ConnectionName $VPNServer -DestinationPrefix 10.10.20.0/24 -PassThru


618383cc666e2063909977.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Bezrukov, 2021-11-04
@nordz0r

what to do with routes based on classes?

You cannot do this directly through PowerShell - there are no such cmdlets. You can edit the phonebook file (essentially an INI file)
c:\Users\'username'\AppData\Roaming\Microsoft\Network\Connections\Pbk\rasphone.pbk
set DisableClassBasedDefaultRoute=1 for the desired connection
Another option: create a separate profileXML , in which to specify the desired settings. Not quite sure what suits your case...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question