2018/02/12

How to install IKEv2 VPN Service on Ubuntu Server 16.04

Download install script from Github
wget --no-check-certificate https://raw.githubusercontent.com/quericy/one-key-ikev2-vpn/master/one-key-ikev2.sh

Modify script file permission
chmod +x one-key-ikev2.sh

Run script
bash one-key-ikev2.sh

Set Server Configuration
Reference URL: https://github.com/quericy/one-key-ikev2-vpn

Installation completed










Set iptables rule for internet connection
sudo iptables -t nat -A POSTROUTING -s 10.31.2.0/24 -o enp0s3 -j MASQUERADE

Save iptables rule
apt install iptables-persistent netfilter-persistent

Add IPsec start up script

chmod +x /etc/rc.local && sed -i '$d' /etc/rc.local && echo "/usr/local/sbin/ipsec start" >> /etc/rc.local && echo "exit 0" >> /etc/rc.local

Add User or modify key password
nano /usr/local/etc/ipsec.secrets

Modify Connection Configuration
nano /usr/local/etc/ipsec.conf

Monitor network traffic
apt install iftop

沒有留言:

張貼留言