aboutsummaryrefslogtreecommitdiff
path: root/client_config_archlinux.sh.sample
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--client_config_archlinux.sh.sample71
1 files changed, 71 insertions, 0 deletions
diff --git a/client_config_archlinux.sh.sample b/client_config_archlinux.sh.sample
new file mode 100644
index 0000000..13cfe04
--- /dev/null
+++ b/client_config_archlinux.sh.sample
@@ -0,0 +1,71 @@
+#!/bin/sh
+VPN_SERVER_IP='vpn_ip'
+VPN_IPSEC_PSK='vpn_psk_key'
+VPN_USER='vpn_user'
+VPN_PASSWORD='vpn_pass'
+
+sudo cat > /etc/ipsec.conf <<EOF
+# ipsec.conf - strongSwan IPsec configuration file
+
+# basic configuration
+
+config setup
+ # strictcrlpolicy=yes
+ # uniqueids = no
+
+# Add connections here.
+
+# Sample VPN connections
+
+conn %default
+ ikelifetime=60m
+ keylife=20m
+ rekeymargin=3m
+ keyingtries=1i
+ keyexchange=ikev1
+ authby=secret
+ ike=aes128-sha1-modp1024,3des-sha1-modp1024!
+ esp=aes128-sha1-modp1024,3des-sha1-modp1024!
+conn myvpn
+ keyexchange=ikev1
+ left=%defaultroute
+ auto=add
+ authby=secret
+ type=transport
+ leftprotoport=17/1701
+ rightprotoport=17/1701
+ right=$VPN_SERVER_IP
+EOF
+
+sudo cat > /etc/ipsec.secrets <<EOF
+: PSK "$VPN_IPSEC_PSK"
+EOF
+
+sudo chmod 600 /etc/ipsec.secrets
+
+cat > /etc/xl2tpd/xl2tpd.conf <<EOF
+[lac myvpn]
+lns = $VPN_SERVER_IP
+ppp debug = yes
+pppoptfile = /etc/ppp/options.l2tpd.client
+length bit = yes
+EOF
+
+sudo cat > /etc/ppp/options.l2tpd.client <<EOF
+ipcp-accept-local
+ipcp-accept-remote
+refuse-eap
+require-chap
+noccp
+noauth
+mtu 1280
+mru 1280
+noipdefault
+defaultroute
+usepeerdns
+connect-delay 5000
+name $VPN_USER
+password $VPN_PASSWORD
+EOF
+
+sudo chmod 600 /etc/ppp/options.l2tpd.client