CentOS6.3 に OpenVPN を入れてみた。最近はテザリングも簡単にできるし無料wi-fiスポットもあるけどopenvpnを使用することによってファイル送受信経路の暗号化やなにやらもいいことばかりなので設定してみました。
実際テストするには、自宅の回線とは別回線がないと色々確認できない部分も多いので若干敷居が高いのかもしれませんね。
tun(L2)で接続し、通信プロトコルは TCP を選択してます(会社などUDP禁止しているところもあるんで)。 あとクライアントからの接続には、固定のIPを払い出しするように設定してます(IPにより内部に入れるようにしたいため)
# grep -v "^#" /etc/openvpn/server.conf | grep -v "^;" | grep -v "^$" port 1194 proto tcp dev tun ca ca.crt cert server.crt key server.key # This file should be kept secret dh dh1024.pem server 10.9.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "route 192.168.0.0 255.255.255.0" client-config-dir ccd client-to-client duplicate-cn keepalive 10 120 tls-auth ta.key 0 # This file is secret comp-lzo user nobody group nobody persist-key persist-tun status openvpn-status.log log-append /var/log/openvpn.log verb 3 management localhost 7505 crl-verify crl.pem
$ ls -1 /etc/openvpn/ccd client-1 client-2 $ cat client-1 ifconfig-push 10.9.0.101 10.9.0.102