DropVPS Team
Writer: Cooper Reagan
Configuring Ports for VPN Connections in Windows

Table of Contents
What you will read?
A Virtual Private Network (VPN) allows users to securely connect to a private network over the internet, providing encryption and anonymity by tunneling data through a secure server. VPN connections rely on certain ports to establish these secure tunnels between clients and servers. These ports, defined by specific protocols, are essential for the communication between devices over the internet. Without properly configuring these ports, a VPN connection can fail to establish, compromising security and access.
Configuring Windows Firewall for VPN Access
When setting up a VPN on Windows, it’s essential to ensure that your firewall settings are properly configured to allow VPN traffic to pass through. Windows Firewall is designed to block unauthorized access to your computer, but in the case of VPNs, certain ports need to be open to allow a secure connection to be established. Without the correct port configurations, your VPN connection may fail.
First, understand which VPN protocol you’re using, as different protocols require different ports. For example, PPTP requires port 1723 (TCP), L2TP/IPsec needs ports 1701 (UDP) for L2TP and 500 and 4500 (UDP) for IPsec, SSTP typically uses port 443 (TCP), and IKEv2 uses ports 500 and 4500 (UDP). Knowing the correct ports for your protocol will help you set up the firewall rules.
To configure Windows Firewall for VPN access, follow these steps:
- Open Windows Firewall Settings:
Go to Control Panel > Windows Defender Firewall. On the left-hand side, click Advanced Settings to open the Windows Firewall with Advanced Security. - Create Inbound Rules:
In the Advanced Settings window, select Inbound Rules. These rules control the traffic allowed into your computer. Click New Rule on the right side. - Choose Rule Type:
Select Port as the rule type, then click Next. - Specify Ports:
Choose TCP or UDP, depending on the VPN protocol you’re using, and enter the port number. For example, if you’re using PPTP, enter 1723 under TCP. For L2TP/IPsec, you might need to enter 1701, 500, and 4500 under UDP. - Allow Connection:
Select Allow the connection to ensure that the traffic on the specified ports is allowed through the firewall. Click Next. - Apply the Rule:
You’ll then be asked to specify when the rule applies (Domain, Private, or Public). Choose the appropriate network profile for your setup, then give the rule a name (e.g., “Allow PPTP VPN”). - Repeat for Other Ports:
If your VPN uses multiple ports (like L2TP/IPsec or IKEv2), repeat these steps for each port, ensuring that all necessary ports are allowed.
Once you’ve set up the necessary inbound rules, the Windows Firewall will allow VPN traffic to pass through, facilitating a secure and uninterrupted connection. If you’re using third-party firewall software, the process will be similar, but you’ll need to consult the specific software’s documentation for creating rules.
By properly configuring the firewall, you can ensure that the VPN connection remains secure and free from external interference.
Changing VPN Ports in Windows
Changing the default VPN ports in Windows is typically not a straightforward task using the built-in VPN client, as it does not allow you to directly modify the port numbers for protocols like PPTP, L2TP/IPsec, or SSTP. However, it is possible to adjust the port settings in certain cases, depending on the VPN protocol you’re using. Below are the general methods to change VPN ports in Windows.
For PPTP (Point-to-Point Tunneling Protocol)
PPTP uses port 1723 (TCP) by default. Changing the port for PPTP on Windows is not natively supported. However, you can modify the server side of the connection to use a different port if needed. On the client side, PPTP will always listen on port 1723 unless you use a third-party tool to configure custom ports.
For L2TP/IPsec (Layer 2 Tunneling Protocol)
L2TP/IPsec typically uses:
- Port 1701 (UDP) for L2TP
- Port 500 (UDP) for IPsec key exchange
- Port 4500 (UDP) for NAT traversal
Changing the ports for L2TP/IPsec in Windows requires modifying settings on the server side to match the new port configuration. The Windows VPN client doesn’t allow you to directly change these ports; however, you can configure the firewall to redirect traffic to different ports if needed.
For SSTP (Secure Socket Tunneling Protocol)
SSTP uses port 443 (TCP), the same port used for HTTPS traffic. Changing this port is generally not recommended because it could interfere with other HTTPS traffic. However, for advanced setups, if you have control over the server, you can reconfigure SSTP to listen on a different port by modifying the server’s IIS (Internet Information Services) settings.
For IKEv2 (Internet Key Exchange version 2)
IKEv2 uses:
- Port 500 (UDP) for the initial key exchange
- Port 4500 (UDP) for NAT traversal
Again, changing these ports on Windows is typically done on the server side, and the client will automatically adjust to the new configuration. You would need to update the VPN server settings and ensure that your firewall allows the new port numbers.
Using Third-Party VPN Clients
If you need to change the port numbers directly on the client side, you will likely need to use third-party VPN software like OpenVPN. These programs allow more flexibility, including changing port numbers for both the client and server.
For example, OpenVPN allows you to modify the port in its configuration file, and you can also configure Windows firewall settings to allow traffic on the new port. This method provides more customization and control over the VPN configuration.
Firewall Configuration
Regardless of the VPN protocol you’re using, you’ll need to adjust your Windows Firewall settings to ensure that traffic on the new ports is allowed. This can be done by creating inbound rules in Windows Defender Firewall or using a third-party firewall solution. You’ll need to specify the port and the protocol (TCP or UDP) that the VPN service uses to ensure proper connectivity.
In summary, changing VPN ports on the Windows client itself is limited, and most adjustments need to be made on the server side or by using third-party VPN software. If you’re using Windows’ built-in VPN client, you’ll often be restricted to the default ports for each protocol unless you configure the server or firewall appropriately.