Skip to content

Instantly share code, notes, and snippets.

@ryanmaclean
Last active December 9, 2021 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanmaclean/9576ed791af401dee5629d56fd69c5a0 to your computer and use it in GitHub Desktop.
Save ryanmaclean/9576ed791af401dee5629d56fd69c5a0 to your computer and use it in GitHub Desktop.
Create VPN for Ubiquiti Edge Router Lite 3

Edge Router Lite VPN Config Script

First, get into config mode with configure

From here, edit the following interface, pool. start and end, PSK, local users and DNS server (add more if needed):

set vpn ipsec ipsec-interfaces interface eth0
set vpn l2tp remote-access dhcp-interface eth0
set vpn l2tp remote-access client-ip-pool start 10.10.10.150
set vpn l2tp remote-access client-ip-pool stop 10.10.10.199
set vpn l2tp remote-access ipsec-settings authentication mode pre-shared-secret
set vpn l2tp remote-access ipsec-settings authentication pre-shared-secret "ujbna105wwdkjnaskdjn89"
set vpn l2tp remote-access authentication mode local
set vpn l2tp remote-access authentication local-users username bob password bobbob
set vpn l2tp remote-access mtu 1492
set vpn l2tp remote-access dns-servers server-1 10.10.10.2

You can now commit the configuration with the commit command, and save it with save.

You can also verify what was written with the following command:

show vpn l2tp remote-access

Now type exit twice in order to exit the configuration editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment