Creating a PPTP VPN server via Global IP on the internet with routed Remote Access on Windows Server 2019 and using a user named UserVPN:
- Install the Routing and Remote Access Service (RRAS) on Windows Server 2019.
Add-WindowsFeature RRAS-Server,Routing
- Configure RRAS to allow VPN connections.
Enable-NetAdapterRRAS -InterfaceAlias "Ethernet"
Replace "Ethernet" with the appropriate network interface.
- Set up the PPTP VPN server.
Set-VpnServer -Name "ServerName" -Protocol PPTP
Replace "ServerName" with the server's name.
- Create a new user for VPN access.
New-LocalUser -Name "UserVPN" -Password (ConvertTo-SecureString -AsPlainText "Password" -Force)
- Add the new user to the Remote Access Server Users group.
Add-LocalGroupMember -Group "Remote Access Server Users" -Member "UserVPN"
- Set up VPN connection properties.
Set-VpnServer -Name "ServerName" -AuthenticationMethod MSCHAPv2
Set-VpnServer -Name "ServerName" -CallerID "ServerName"
- Configure routing for the VPN connections.
New-NetRoute -DestinationPrefix 0.0.0.0/0 -NextHopType IPAddress -NextHop "VPNServerIP"
Replace "VPNServerIP" with the IP address of the VPN server.
- Start the RRAS service.
Start-Service Routing and Remote Access
Now, clients can connect to the VPN server using their VPN client software and the provided username and password.
References: