18th June 2024

A site-to-site VPN helps to determine a safe connection between two separate places. This configuration permits clean communication amongst gadgets on the primary or second community. Superior settings can additional refine the site visitors limits, however the main focus is to efficiently arrange the site-to-site VPN connection. There are two kinds of configurations – A site-to-site VPN in UniFi utilizing IPsec and OpenVPN.

  • Each IPSec and OpenVPN setups might be difficult, particularly when coping with double-NAT configurations.
  • When you have a double-NAT (UniFi machine behind a router), you need to arrange port forwarding on the router to the UniFi machine.
  • When you’re utilizing dynamic exterior IP addresses, then OpenVPN setup with DDNS is advisable, as IPSec requires static exterior IP addresses.
  • When you have two UniFi gateways immediately related to your modem the setup course of is straightforward. It turns into tough once you add in numerous variables.

Allow us to see the steps to arrange a site-to-site VPN In UniFi utilizing IPSec. Earlier than beginning, the distant server should be entered as an IPv4 handle. If neither server has a static exterior IP handle, you’ll encounter points when the IP handle adjustments. In the event you want to make use of DDNS, take into account the OpenVPN setup as an alternative.

Configure a Website-to-Website VPN in UniFI utilizing IPSec

  1. Open the UniFi Controller within the First UniFi machine and choose Settings.
  2. Choose Teleport & VPN from the Settings menu.
  3. Within the Website-to-Website VPN, choose create site-to-site VPN.
  4. Now you can Identify the VPN, choose Handbook IPsec within the VPN Protocol, and set the right WAN handle within the UniFi Gateway IP.

Word: In the event you don’t have a static exterior IP handle then the WAN handle will change periodically. When the WAN handle adjustments, the site-to-site VPN will cease working.

  1. Within the Distant Machine Configurations, enter the subnets you need to route by this VPN tunnel and enter the opposite server’s exterior IP handle into the Distant IP.
  2. Repeat the earlier steps to create a brand new site-to-site VPN within the second UniFi machine. The settings shall be fairly related, nevertheless, these are the primary variations: Pre-shared Key: The identical key utilized by the opposite server, Subnet: The subnet you need to hook up with on the opposite community and Distant IP: Exterior IP handle for the primary UniFi machine.
  3. Be sure that the settings are saved and that each UniFi gadgets are arrange. If the pre-shared keys are the identical and the entered IP addresses are right it is possible for you to to attach.

Configure a Website-to-Website VPN in UniFI utilizing OpenVPN

  1. First, get your SSH Authentication username and password by logging into the UniFi Controller. Choose the Setting > System >Community Machine SSH Authentication. Be sure that Machine SSH Authentication is enabled after which copy the password. Word: Chances are you’ll must allow SSH within the Console Settings, which can immediate you to set an SSH password.
  2. Now open a terminal window or SSH software and hook up with the UniFi machine.
 ssh username@UNIFI_IP_ADDRESS
  1. To generate a brand new OpenVPN key run the under command:
 openvpn --genkey secret /tmp/ovpn
  1. As soon as the secret is created, let’s test it to make use of within the OpenVPN setup. Run the command and duplicate it to Notepad, then delete the road breaks. Save the lengthy OpenVPN key for later.
  2. Open the UniFi Controller within the First UniFi machine and choose Settings.
  3. Choose Teleport & VPN from the Settings menu.
  4. Within the Website-to-Website VPN, choose create site-to-site VPN.
  5. Now you can Identify the VPN, choose OpenVPN within the VPN Protocol, and set a novel native tunnel IP handle. This shall be utilized in each the UniFi gadgets.

Word: In case you are already utilizing OpenVPN on the supply or vacation spot server, then you should use a unique port quantity.

  1. Now enter the shared distant subnets you need to use and the distant IP handle. Enter the distant tunnel IP handle and port – it should be distinctive and match what’s configured on the distant server. As soon as after the setup, choose Add New VPN Community.
  2. Create a brand new site-to-site VPN within the second UniFi machine and add the primary VPN server’s pre-shared key. Enter the identical data as you probably did for the distant tunnel IP handle and port within the earlier step.
  3. Enter the shared distant subnets that you simply need to route over the VPN tunnel (The distant IP handle, and the identical distant tunnel IP handle used within the earlier step). After finishing this, choose Add New VPN Community.
  4. After ending the setup, the shared distant subnets of every server must be obtainable relying on which community you might be related to. It is because UniFi ought to deal with the entire routing for you.

The method of Organising a site-to-site VPN in UniFi utilizing IPsec and OpenVPN is beneficial as a result of UniFi manages all of the routing, which is normally the hardest half. Nonetheless, it’s necessary to notice that if you happen to don’t have two UniFi gadgets arrange as routers (double-NAT), then the setup will turn out to be extra advanced.

Hope these steps helped you to arrange a site-to-site VPN in UniFi. In the event you want any help be happy to Get Help.

To get extra updates you’ll be able to observe us on Fb, Twitter, LinkedIn

Subscribe to get free weblog content material to your Inbox

Written by actsupp-r0cks

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.