OpenVPN インストール

Nid: 691

 

$ sudo apt-get update && sudo apt-get install openvpn easy-rsa

設定ファイル編集

$ gunzip -c /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz | sudo tee /etc/openvpn/server.conf
$ sudo sed -i.bak -e 's/^dh dh1024.pem/dh dh2048.pem/' -e 's/;push "redirect-gateway def1 bypass-dhcp"/push "redirect-gateway def1 bypass-dhcp"/' -e 's/;push "dhcp-option DNS 208.67.222.222"/push "dhcp-option DNS 208.67.222.222"/' -e 's/;push "dhcp-option DNS 208.67.220.220"/push "dhcp-option DNS 208.67.220.220"/' -e 's/;user nobody/user nobody/' -e 's/;group nogroup/group nogroup/' /etc/openvpn/server.conf
$ diff /etc/openvpn/server.conf{.bak,}
87c87
< dh dh1024.pem
---
> dh dh2048.pem
187c187
< ;push "redirect-gateway def1 bypass-dhcp"
---
> push "redirect-gateway def1 bypass-dhcp"
195,196c195,196
< ;push "dhcp-option DNS 208.67.222.222"
< ;push "dhcp-option DNS 208.67.220.220"
---
> push "dhcp-option DNS 208.67.222.222"
> push "dhcp-option DNS 208.67.220.220"
262,263c262,263
< ;user nobody
< ;group nogroup
---
> user nobody
> group nogroup