VPNs (virtual private networks) allow users to safely access the internet. However, they need a VPN client to do so. VPN clients are the end-user software that initiate the VPN connection by running a security protocol to establish a tunnel. This tunnel then connects the client to the VPN server. Afterward, the server authenticates the client based on credentials and permits a connection to the VPN network. These clients are versatile and can run on different platforms, especially consumer ones. In line with that, many VPN providers allow you to connect using cmd, better known as Command Prompt or more vaguely, a command-line interface.
This is not a preferred method, however. All major VPN vendors have products for plenty of operating systems out there. But sometimes, users don’t want to install a client to stay secure. In the case of Windows operating systems, users can employ Command Prompt to initiate a VPN connection. Hence, today’s article will focus on how to connect to a VPN from cmd. To expand on that, we also included three different methods for our readers, all permitting a manual VPN connection by integrating cmd.
What is a VPN?
Before we begin our write-up, you’ll need to know what a VPN is and how it works. Though we linked a detailed article, we ought to give you a breakdown if you’re in a hurry to connect. Like other networks, VPN relies on different nodes to establish an exchange of resources. They use servers (computer hosting server software) to relay incoming transmission and transfer data. User employs the client (end-user device software) to establish a connection, while VPNs use tunneling for their infrastructure. Tunneling also allows remote access to resources. Moreover, it protects data traffic from the prying of a third party by employing encryption based on security protocols.
These protocols dictate how data must travel and which encryption profile to use. Plus, they decide on key exchange and cipher. In short, VPNs are the forerunner for online safety and privacy. Although, there are alternate methods users can employ, such as SOCKS5 proxy or Tor (The Onion Router). However, VPNs are much more trustworthy. Having said that, they are also an integral part of the corporate world as they simplify remote workforce problems. Thus, it is paramount that users understand how to connect to a VPN with cmd.
Connect to VPN using the rasphone.exe executable
The following steps will allow you to connect to a VPN using a rasphone (Remote Access Phonebook).
- First, open the Run box. You can do so by:
- Pressing the Windows and R keys together on the keyboard.
- Opening the Start menu and typing “run” in the search box.
- Type “rasphone” into the Run box and click on OK.
- Now the “Network connections” box will open.
- In the box, find the drop-down menu before selecting your desired VPN connection.
- Now click on Connect.
- Based on your configurations, you might need to enter your VPN credentials.
- Note. You can skip steps 3 to 5 by simply typing this command in step 2:
- rasphone -d “VPN connection name”
Establishing a VPN connection via a rasdial or a PowerShell command
Both techniques get right into the matter. Here’s the first one that includes rasdial alone:
- Open a Command prompt window. You can do so in two ways:
- Open the Run dialogue box, type “cmd”, and hit Enter.
- Launch the Start menu and enter “cmd” into the search box.
- In the Command Prompt window, enter the command: rasdial
- After that, to connect to a specific VPN, enter the command: rasdial “VPN Name” “Username” “Password”
You can also utilize PowerShell alongside the rasdial command to establish a VPN connection with cmd. Here’s what to do:
- Start by opening the Command prompt window as described above.
- Enter the command PowerShell Get -VpnConnection and hit Enter. This will list all the available VPN connections.
- Type the rasdial command from step 3 above.