Created
January 22, 2022 04:59
-
-
Save ndgnuh/efa32f1c45857aba2b111a9e8ea12b52 to your computer and use it in GitHub Desktop.
New L2TP Connection profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://askubuntu.com/questions/1167283/l2tp-connection-client-on-ubuntu-18-04-server | |
VPNDATA=" | |
gateway = [ipv4], | |
ipsec-enabled = yes, | |
ipsec-psk = 0s"$(base64 <<<'[PSK]' | rev | cut -c2- | rev)"=, | |
mru = 1400, | |
mtu = 1400, | |
password-flags = 0, | |
refuse-chap = yes, | |
refuse-mschap = yes, | |
refuse-pap = yes, | |
require-mppe = yes, | |
user = [user]" | |
nmcli connection add\ | |
connection.id [vpnName] \ | |
con-name [vpnName] \ | |
type VPN vpn-type l2tp \ | |
ifname \ | |
-- connection.autoconnect no \ | |
ipv4.method auto \ | |
vpn.data "$VPNDATA" \ | |
vpn.secrets password=[user-password] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment