One of the most effective ways to secure your network is to deploy a Virtual Private Network (VPN) — and the second is to set up a VPN behind a firewall. However, setting up a VPN behind an existing firewall requires careful configuration to avoid connectivity issues and maintain security.
This guide provides a comprehensive step-by-step approach to setting up an OpenVPN server behind a firewall, ensuring seamless remote access while preserving network integrity. For the purposes of this blog, we will specifically be referring to setting up Access Server behind an existing firewall.
A firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. It acts as a barrier between a trusted internal network and untrusted external networks, such as the internet. Firewalls help prevent unauthorized access, mitigate cyber threats, and ensure data security.
There are different types of firewalls, including:
Firewalls can impact VPN traffic in several ways. By default, they may block VPN-related traffic to prevent unauthorized access or data leaks. Properly configuring a firewall to allow VPN connections while maintaining security is crucial. Without the right settings, VPN users may experience connectivity issues, restricted access, or degraded performance.
Firewalls typically interact with VPN servers in the following ways:
Getting the right VPN in place is the first step. If you’re not sure where to start, check out our IT Admin’s Guide to Evaluating Network Security Solutions.
If you’re here, you likely already know that OpenVPN offers strong encryption, cross-platform compatibility, and extensive configurability. OpenVPN also supports multiple authentication methods, making it ideal for businesses that require secure remote access.
As a reminder, the rest of this guide will refer specifically to setting up Access Server behind a firewall.
Before setting up OpenVPN, ensure your system meets the following requirements:
Access Server performs intensive Central Processing Unit (CPU) operations for encryption and decryption tasks. Therefore, we don't recommend running Access Server on a shared-purpose platform, such as a cPanel or configServer hosting server. Access Server shouldn't coexist with other applications on the same server in that way. Further, other programs that manage firewall rules will likely interfere with Access Server's firewall functionalities. While technically possible, running multiple programs of this nature simultaneously isn't advised.
On Red Hat Enterprise Linux 8 and 9, we advise you to remove the firewalld daemon:
sudo su
systemctl stop firewalld
systemctl disable firewalld
yum erase firewalld
The default firewalld on RHEL conflicts with Access Server, which implements its own firewall rules for VPN traffic.
Access Server works best over UDP. However, TCP 443 is the preferred fallback option when firewalls block UDP. If you’re managing your own firewall, you can open the UDP port, 1194, and allow that traffic.
You may be wondering why we recommend using TCP 443. The short answer: firewall compatibility. Many public networks block traffic on all ports except a few (e.g., HTTP, HTTPS, FTP, email). By running OpenVPN on TCP 443 (the default port for HTTPS), VPN connections can bypass these restrictions.
Use Access Server to set up secure access to a private network behind a firewall. This configuration includes the following:
Note: You may have other interfaces present on the system not utilized by Access Server.
For this configuration, the internet gateway forwards TCP/UDP port traffic from the public-facing IP address to Access Server’s private IP address. At a minimum, one TCP port (typically port 443) is forwarded. That TCP port can carry both the VPN tunnel traffic and the web server/VPN client traffic. Optionally, you can separate VPN tunneling from web server traffic, in which case an additional TCP or UDP port (e.g., UDP port 1193) is forwarded for the VPN tunnel.
A variation on this network configuration has Access Server with one interface attached to a DMZ network provided by the firewall. As mentioned above, the same forwarding of client traffic is required. Additionally, you may need to configure the firewall to allow traffic between Access Server and the private network behind the firewall.
For more detailed information, check out our documentation.
Setting up a VPN behind an existing firewall requires careful planning and configuration. By choosing Access Server, meeting system requirements, and properly configuring firewall rules, IT managers can establish a secure and efficient remote access solution.
Ready to find out more? Join our weekly office hours for a group demo and discussion.