Endian Firewall Reference Manual r. 2.2.1.9

Copyright (c) 2008 Endian srl, Italy.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Chapter 7: The VPN Menu

Select VPN from the menu bar at the top of the screen.

Virtual private networks (VPNs) allow networks to connect directly to each other over potentially unsafe networks such as the internet. All network traffic through the VPN connection is transmitted securely, inside an encrypted tunnel, hidden from prying eyes. Such a configuration is called a Gateway-to-Gateway VPN. Similarly, a single computer somewhere on the internet can use a VPN tunnel to connect to a trusted LAN. The remote computer, sometimes called a Road Warrior, appears to be directly connected to the trusted LAN while the VPN tunnel is active.

Endian Firewall can create VPNs based on the IPsec protocol supported by most operating systems and network equipment, as well as VPNs based on the OpenVPN service.

Unfortunately, the tools needed to set up IPsec vary greatly among different systems, may be complicated to use or may have interoperability issues. Therefore, Endian recommends OpenVPN in situations where there is no need to support an existing IPsec infrastructure. Endian Firewall includes a user friendly OpenVPN client for Microsoft Windows, Linux and MacOS X.

Following is a list of links that appear in the submenu on the left side of the screen and that allow setting up VPNs of any of the types mentioned:

Each link will be explained individually in the following sections.

OpenVPN server

Select VPN from the menu bar at the top of the screen, then select OpenVPN server from the submenu on the left side of the screen.

Server configuration

In this panel you can enable the OpenVPN server and define the range of addresses within the GREEN zone that are going to be assigned to connecting clients. Note that traffic directed to this IP pool has to be filtered using the VPN firewall.

Click on Save to save the settings and start the OpenVPN service. The first time the service is started a new (self-signed) certificate for this OpenVPN server is generated. Click on the Download CA certificate link to download it. You will need it later when setting up the clients.

The following panel shows a list of currently connected clients, once OpenVPN is up and running.
It is possible to kill and ban connections. The difference between killing and banning is that banned users are not able to reconnect after their connection has been killed.

Accounts

This panel contains the list of OpenVPN accounts.

Cick on Add account to add an account. The following parameters can be specified for each account:

Account information
Username - user login name
Password / Verify password - specify password (twice)
Client routing
Direct all client traffic
through the VPN server
- if you check this, all the traffic from the connecting client (regardless of the destination) is routed through the uplink of the Endian Firewall that hosts the OpenVPN server. The default is to route traffic with a destination that is not part of any of the internal Endian zones (such as internet hosts) through the client's uplink
Don't push any routes
to client
- (advanced users only) normally, when a client connects, tunneled routes to networks that are accessible via VPN are added to the client's routing table - check this box if you do not want this to happen and are prepared to manipulate your clients' routing tables manually
Networks behind client - only needed if you want to use this account as client in a Gateway-to-Gateway setup: enter the networks behind this client you would like to push to the other clients
Push only these networks - add your own network routes to be pushed to the client here (overrides all automatically pushed routes)
Custom push configuration
Static ip addresses - normally, dynamic IP addresses are assigned to clients, you can override this here and assign a static address
Push these nameservers - assign nameservers on a per-client basis here
Push domain - assign search domains on a per-client basis here

In all of these fields, addresses and networks must be given in CIDR notation (e.g. 192.168.0.0/24).

Click the Save button to save the account settings. You can at any moment disable/enable, edit or delete accounts by clicking on the appropriate icon on the right side of the table (see the icon legend at the bottom).

If you are planning to have two or more branch offices connected through a Gateway-to-Gateway VPN it is good advice to choose different subnets for the LANs in the different branches. For example, one branch might have a GREEN zone with the 192.168.1.0/24 subnet while the other branch uses 192.168.2.0/24. This way, correct routes will be assigned in a fully automatic way and you do not have to deal with pushing custom routes.

Advanced

Use this panel to change advanced settings. Among other things, certificate-based authentication (as opposed to password-based) can be set up in this section.

The first section has some generic settings regarding the server:

Port / Protocol - port 1194 / protocol UDP are the default OpenVPN settings. It is a good idea to keep these values as they are - if you need to make OpenVPN accessible via other ports (possibly more than one), you can use port forwarding (see Firewall, Port Forwarding). A use case for setting TCP as the protocol is when you want to access the OpenVPN server through a third-party HTTP proxy.
Block DHCP responses coming
from tunnel
- check this if you're getting DHCP responses from the LAN at the other side of the VPN tunnel that conflict with your local DHCP server
Don't block traffic
between clients
- the default is to isolate clients from each other, check this if you want to allow traffic between different VPN clients

In the second section you can change the global push options.

Push these networks - if enabled, the routes to the specified networks are pushed to the connected clients
Push these nameservers - if enabled, the specified nameservers are pushed to the connected clients
Push domain - if enabled, the specified search domains are pushed to the connected clients

All addresses and network addresses must be given in CIDR notation (such as 192.168.0.0/24).

The third section lets you specify the authentication method:

Endian Firewall's default method is PSK (username/password). If you want to use this method, you do not have to change the settings here.

The Download CA certificate link lets you download the certificate for this OpenVPN server as it is needed by the clients (this is the public certificate, which is used to verify the authenticity of the server). Furthermore, the Export CA as PKCS#12 file link lets you download the certificate in PKCS#12 format (keep it private!), which can be imported into any OpenVPN server that you wish to use as a fall back server.

Finally, should this system be a fall back system, you can upload the PKCS#12 file that you exported from your primary server (leave "Challenge password" empty if the file came from an Endian Firewall).

If you would rather use a X.509-certificate-based method here (either certificate only or certificate plus password), things get a bit more complicated. It is assumed (and required) that you use an independent certificate authority (CA) for this purpose. It is neither possible nor desired to host such a certificate authority on Endian Firewall.

You need to generate and sign certificates for the server and for every client using your certificate authority. The certificates type must be explicitly specified and be one of "server" and "client" ("netscape certificate type" field).

The server certificate file in PKCS#12 format must be uploaded in this section (specify the "Challenge password" if you supplied one to the certificate authority before or during the creation of the certificate).

The client certificates need to have the common name fields equal to their OpenVPN user names. Watch out: if you use certificate-only authentication a client that has a valid certificate can connect even if there is no corresponding OpenVPN user account!

You can also upload a revocation list, in case you lost a client certificate and hence have revoked it on your CA.

VPN client download

Click on the link to download the Endian VPN client for Microsoft Windows, MacOS X and Linux from Endian Network.

OpenVPN client (Gw2Gw)

Select VPN from the menu bar at the top of the screen, then select OpenVPN client (Gw2Gw) from the submenu on the left side of the screen.

In this section you can set up the client side of a Gateway-to-Gateway VPN connection. Click on Add tunnel configuration to enter information about the OpenVPN server you want to connect to (there can be more than one):

Connection name - just a label for this connection
Connect to - the remote OpenVPN server's fully qualified domain name and port (such as efw.example.com:port) - the port is optional and defaults to 1194
Upload certificate - if the server is configured to use PSK authentication (password/username), you must upload the server's host certificate (the one you get from the Download CA certificate link at the server). Otherwise, if you use certificate-based authentication, you must upload the server's PKCS#12 file (you can get it from the Export CA as PKCS#12 file link on the server (advanced section of the OpenVPN submenu).
PKCS#12 challenge password - specify the "Challenge password" if you supplied one to the certificate authority before or during the creation of the certificate
Username / Password - if the server is configured to use PSK authentication (password/username) or certificate plus password authentication, give the username and password of the OpenVPN server account here
Remark - your comment

Click on Advanced tunnel configuration to see more options:

Fallback VPN servers - specify one or more (one per line) fallback OpenVPN servers in the form efw.example.com:port (the port is optional and defaults to 1194). If the connection to the main server fails, a fallback server will take over.
Connection type - "routed" (the client firewall acts as a gateway to the remote LAN) or "bridged" (as if the client firewall was part of the remote LAN). Default is "routed".
Block DHCP responses coming from tunnel - check this if you are getting DHCP responses from the LAN at the other side of the VPN tunnel that conflict with your local DHCP server
NAT - check this if you want to hide the clients connected through this Endian Firewall behind the firewall's VPN IP address. Doing so will prevent incoming connection requests to your clients.
Protocol - UDP (default) or TCP. Set to TCP if you want to use a HTTP proxy (next option).
HTTP proxy - if your Endian Firewall can access the internet only through an upstream HTTP proxy it is still possible to use it as an OpenVPN client in a Gateway-to-Gateway setup. However, you must use the TCP protocol for OpenVPN on both sides. Fill in the HTTP proxy account information in these text fields: proxy host (such as proxy.example.com:port, where port defaults to 8080), username and password. You can even use a forged user agent string if you want to camouflage your Endian Firewall as a regular web browser.

Click the Save button to save the tunnel settings. You can at any moment disable/enable, edit or delete tunnels from the list by clicking on the appropriate icon on the right side of the table (see the icon legend at the bottom).

IPsec

Select VPN from the menu bar at the top of the screen, then select IPsec from the submenu on the left side of the screen.

IPsec (IP Security) is a generic standardized VPN solution. As opposed to OpenVPN encryption and authentication are already done on the OSI layer 3 as an extension to the IP protocol. Therefore IPsec must be implemented in the IP stack which is part of the kernel. Since IPSec is a standardized protocol it is compatible to most vendors that implement IPsec. Compared to OpenVPN IPsec's configuration and administration is usually quite difficult due to its complexity. Because of its design some situations are even impossible to handle, whereas they work well with OpenVPN, especially if you have to cope with NAT. However, Endian Firewall implements an easy to use adminstration interface that supports different authentication methods. We strongly encourage you to use IPSec only if you need to because of interoperability purposes. Use OpenVPN wherever you can, especially if you have to work with NAT.

In the Global settings section you can set the main parameters for your IPsec configuration. The values you can set are:

Local VPN hostname/IP - Here you can enter the external IP (or a fully qualified domain name) of your IPsec host.
Enabled - By ticking this checkbox you enable IPsec.
VPN on ORANGE - If this is enabled it is possible for a user to connect to the VPN from the ORANGE zone.
VPN on BLUE - If this is enabled it is possible for a user to connect to the VPN from the BLUE zone.
Override default MTU - If you want to override the default maximum transmission unit you can specifiy the new value here. Usually this is not needed.
Debug options - Ticking checkboxes in this section will increase the amount of data that is logged to /var/log/messages.

In the Connection status and control section you can see a list of accounts and their connection status. The list shows Name, Type, Common name, Remark and Status of each connection. By clicking on the icons in the Actions column you can perform various actions as described in the icon legend below the list.
You can add a connection by clicking on the Add button. A page will open and you can choose whether you want to add a Host-to-Net Virtual Private Network or a Net-to-Net Virtual Private Network. Submit your choice by clicking on the Add button.
On the next page you can specify the details for this connection (you will also see this page when editing an existing connection). You can configure the network parameters in the first section of the page:

Name - the name of this connection
Enabled - if checked, this connection is enabled
Interface - this is only available for host-to-net connections and specifies to which interface the host is connecting
Local subnet - the local subnet in CIDR notation, e.g. 192.168.15.0/24
Local ID - an ID for the local host of the connection
Remote host/IP - the IP or fully qualified domain name of the remote host
Remote subnet - this is only available for net-to-net connections and specifies the remote subnet in CIDR notation, e.g. 192.168.16.0/24
Remote ID - an ID for the remote host of this connection
Dead peer detection action - what action should be performed if a peer disconnects
Remark - a remark you can set to remember the purpose of this connection later
Edit advanced settings - tick this checkbox if you want to edit more advanced settings

In the Authentication section you can configure how authentication is handled.

Use a pre-shared key - Enter a pass phrase to be used to authenticate the other side of the tunnel. Choose this if you wish a simple Net-to-Net VPN. You can also use PSKs while experimenting in setting up a VPN. Do not use PSKs to authenticate Host-to-Net connections.
Upload a certificate request - Some roadwarrior IPSec implementations do not have their own CA. If they wish to use IPSec's built in CA, they can generate what a so called certificate request. This partial X.509 certificate must be signed by a CA. During the certificate request upload, the request is signed and the new certificate will become available on the VPN's main web page.
Upload a certificate - In this case, the peer IPSec has a CA available for use. Both the peer's CA certificate and host certificate must be included in the uploaded file.
Upload PKCS12 file - PKCS12 file password - Choose this option to upload a PKCS12 file. If the file is secured by a password you must also enter the password in the text field below the file selection field.
Generate a certificate - You can also create a new X.509 certificate. In this case, complete the required fields. Optional fields are indicated by red dots. If this certificate is for a Net-to-Net connection, the User's Full Name or System Hostname field must contain fully qualified domain name of the peer. The PKCS12 File Password fields ensure that the host certificates generated cannot be intercepted and compromised while being transmitted to the IPSec peer.

If you have chosen to edit the advanced settings of this connection, a new page will open after you hit the Save button. In this page you can set Advanced connection settings. Unexperienced users should not change the settings here:

IKE encryption - Here you can specify which encryption methods should be supported by IKE (Internet Key Exchange).
IKE integrity - Here you can specifiy which algorithms should be supported to check the integrity of packets.
IKE group type - Here you can specify the IKE group type.
IKE lifetime - Here you can specify how long IKE packets are valid.
ESP encryption - Here you can specify which encryption methods should be supported by ESP (Encapsulating Security Payload).
ESP integrity - Here you can specify which algorithms should be supported to check the integrity of packets.
ESP group type - Here you can specify the ESP group type.
ESP key lifetime - Here you can specify how long an ESP key should be valid.
IKE aggressive mode allowed - Check this box if you want to enable IKE aggressive mode. You are encouraged NOT to do so.
Perfect Forward Secrecy - If this box is checked perfect forward secrecy is enabled.
Negotiate payload compression - Check this box, if you want to use payload compression.

Finally save the settings by clicking on the Save button.

Back on the main IPsec page you can generate new certificates and upload existing CA certificates in the Certificate authorities section.
To upload a new certificate you have to provide a name in the CA name field. Then click on browse and select the certificate file before clicking the Upload CA certificate button.
To generate new root and host certificates just click on the Generate root/host certificates button. You will see a new page where you can enter the required information.
If you already created certificates and want to create new certificates you must click on the Reset button. Please note that by doing this not only the certificates but also certificate based connections will be erased.

If you want to generate new root and host certificates some information has to be entered. The fields are described below:

Organization name - The organization name you want to use in the certificate. For example, if your VPN is tying together schools in a school district, you may want to use something like “Some School District.”
Endian Firewall hostname - This is used to identify the certificate. Use a fully qualified domain name or the firewall's RED IP address.
Your email address - Here you can enter your email address.
Your department - Here you can enter a department name.
City - Here you can enter the name of your town or your city.
State or province - Here you can enter the name of the state or province you are living in.
Country - Choose your country here.
Subject alt name - Here you can specify an alternative hostname for identification.

The certificates are created after clicking on the Generate root/host certificates button.

If you already created certificate somewhere else earlier you can upload a PKCS12 file in the lower section of the page instead of generating new certificates.

Upload PKCS12 file - Open the file selection dialog and select your PKCS12 file here.
PKCS12 file password - If the file is password protected you must enter the password here.

You can upload the file by clicking on the Upload PKCS12 file button.

Creating a Net-To-Net VPN with IPsec using certificate authentication
We have two firewalls A and B, where firewall A is our certification authority.
Firewall A - RED IP: 123.123.123.123, GREEN IP: 192.168.15.1/24
Firewall B - RED IP: 124.124.124.124, GREEN IP: 192.168.16.1/24

The following steps have to be performed on firewall A:
- In the VPN, IPsec menu enable IPsec and specify 123.123.123.123 as Local VPN hostname/IP.
- After saving click on the Generate host/root CA certificate button (unless you already generated these certificates before) and compile the form.
- Download the host certificate and save it as fw_a_cert.pem.
- In the Connection status and control section click on the Add button.
- Select Net-to-Net.
- Enter 124.124.124.124 in the Remote host/IP field, 192.168.15.0/24 as Local subnet and 192.168.16.0/24 as Remote subnet.
- In the Authentication section select Generate a certificate and compile the form, make sure to set a password.
- After saving, download the PKCS12 file and save it as fw_a.p12.

The following steps have to be performed on firewall B:
- In the VPN, IPsec menu enable IPsec and specify 124.124.124.124 as Local VPN hostname/IP.
- After saving click on the Generate host/root CA certificate button (if you already generated them earlier you must Reset the previous certificates).
- Do not compile anything in the first section! Instead upload the fw_a.p12 file and enter the password you set on firewall A.
- Click on Add in the Connection status and control section.
- Select Net-To-Net.
- Enter 123.123.123.123 in the Remote host/IP field, 192.168.16.0/24 as Local subnet and 192.168.15.0/24 as Remote subnet.
- Select Upload a certificate and upload the fw_a_cert.pem you have created on firewall A.