apt install openvpn -y

#test
openvpn --config test.ovpn

#開機啟動
vi /etc/default/openvpn
AUTOSTART="all" #移除註解
cd /etc/openvpn
mv test.ovpn client.conf
systemctl enable openvpn@client.service
systemctl start openvpn@client.service

#iptables Server端
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o $EXTIF -j MASQUERADE
#iptables Client端
iptables -t nat -A POSTROUTING -s 工作端網段/24 -o tun0 -j MASQUERADE