Knowledgebase
Configuring a VPN Appliance for Site to Site Connections
Posted by on 15 June 2017 03:27 PM
|
|
VPN Appliance Powered by OPNsenseThe eApps VPN Appliance is powered by OPNsense, a leading open source network security platform based on FreeBSD. See https://www.opnsense.org. This powerful security platform will allow you to easily create a site to site VPN tunnel between one or more of your eApps Virtual Servers and an external end point that supports the IPsec protocol. The configuration of the VPN Appliance is done using the OPNsense user interface. Some configuration settings on your eApps Virtual Servers must be performed via the command line. This guide explains how to set up your site to site VPN. If you would like to have eApps perform the setup and configuration for you, contact sales@eapps.com. PrerequisitesIn order to configure a site to site VPN, you will need to have the following:
You will also need the following:
Create Static RoutesAdd a static route from each Virtual Server to the OPNsense VPN ApplianceYou will need to use the Private IP you obtained for your OPNsense VPN Appliance in CIDR notation.For Linux: # ip route add OPNSENSE_PRIVATE_IP/CIDR via OPNSENSE_PRIVATE_IP_GATEWAY dev eth1 Next, you will need to restart the network. This depends on the OS you are using. For CentOS 6 and 7: # service network restart For Debian 7, Ubuntu 14 and Ubuntu 16: # service networking restart For Windows Server, please see https://technet.microsoft.com/en-us/library/ff961510(v=ws.11).aspx Add a static route from the OPNsense VPN Appliance to each Virtual ServerLog in to your OPNSense VPN Appliance's dashboard and navigate to System > Routes > All > Add Route and use the following settings:Destination network: VIRTUAL_SERVER_PRIVATE_IP/CIDRClick Apply Changes Create the IPSec VPN TunnelCreate Phase 1 IPSec Tunnel in OPNsense VPN ApplianceIn your OPNsense VPN Appliance dashboard, navigate to VPN > IPsec > Tunnel Settings. Click the + icon to add a new Phase 1 entry. Your settings may very depending on what was agreed with the remote end. For this example, we will use the following settings:===General information=== Create Phase 2 IPSec Tunnel in OPNsense VPN ApplianceIn your OPNsense VPN Appliance dashbaord, navigate to VPN > IPsec > Tunnel Settings. Click on Show 0 Phase-2 entries, then click the + icon to add new Phase 2 entry. Your settings may very depending on what was agreed with the remote end. For this example, we will use the following settings:===General information=== Click Apply Changes Create GRE TunnelsA Generic Routing Encapsulation (GRE) tunnel is necessary in order for the Virtual Servers behind your OPNsense appliance to be able to communicate with the network behind the VPN device at the remote end.Create GRE Tunnel Default Gateway on VPN ApplianceIn your OPNsense VPN Appliance dashboard, navigate to System > Gateways > All > +Add gateway and use the following settings:Disabled: UncheckedClick Save Create GRE Tunnel on OPNsense VPN ApplianceIn your OPNsense VPN Appliance dashboard, navigate to Interface > Other types > GRE > click Add and use the following settings:Parent interface: LAN Create GRE tunnel on each Virtual Server behind the OPNsense VPN ApplianceCreate/etc/sysconfig/network-scripts/ifcfg-tun0 with the following contents:
DEVICE=tun0Note that MY_INNER_IPADDR is the same as GRE tunnel remote address in OPNsense , and PEER_INNER_IPADDR is the same as GRE tunnel local address in OPNsense. For each additional Virtual Server you configure with a GRE tunnel, you will have to increase MY_INNER_IPADDR by one. For example, on your second Virtual Server, MY_INNER_IPADDR would be 172.31.1.3. Configure Servers to Use GRE TunnelsConfigure static route on Virtual Server to use GRE TunnelOn each the endpoint Virtual Server create/etc/sysconfig/network-scripts/route-tun0 with the following contents:
REMOTE_PEER_PUBLIC_IP/CIDR via 172.31.1.1 dev tun0 src VIRTUAL_SERVER_PUBLIC_IP onlinkBring the tunnel up: # ifup tun0 Configure static route on OPNsense VPN Appliance to use the GRE TunnelIn your OPNsense VPN Appliance dashboard, navigate to System > Routes > All > Add route and use the following settings:Destination network: VIRTUAL_SERVER_PUBLIC_IP/CIDRClick Apply Changes Test VPN TunnelTo test the that the site to site VPN tunnel is working properly, try to reach a server located on the remote and from one of your eApps Virtual Servers behind your OPNsense VPN Appliance | |
|
Comments (0)