Openvpn on Centos

設定網卡

沒有 wget,那就來裝一下。

yum install wget

wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm

執行 yum install openvpn ,裝了下面的套件

  Installing : libtasn1-2.3-3.el6_2.1.i686                                  1/5
  Installing : gnutls-2.8.5-10.el6_4.1.i686                                 2/5
  Installing : pkcs11-helper-1.08-1.el6.rf.i686                             3/5
  Installing : lzo-2.03-3.1.el6.i686                                        4/5
  Installing : openvpn-2.2.2-1.el6.rf.i686                                  5/5

所以又 yum remove openvpn lzo pkcs11-helper gnutls libtasn1

下載 http://swupdate.openvpn.org/as/openvpn-as-1.8.5-CentOS6.i386.rpm 來裝,看會不會比較簡單

rpm -Uvh openvpn-as-1.8.5-CentOS6.i386.rpm

[root@localhost ~]# rpm -Uvh openvpn-as-1.8.5-CentOS6.i386.rpm
Preparing...                ########################################### [100%]
   1:openvpn-as             ########################################### [100%]
The Access Server has been successfully installed in /usr/local/openvpn_as
Configuration log file has been written to /usr/local/openvpn_as/init.log
Please enter "passwd openvpn" to set the initial
administrative password, then login as "openvpn" to continue
configuration here: https://10.161.91.134:943/admin
To reconfigure manually, use the /usr/local/openvpn_as/bin/ovpn-init tool.

裝好後,記得把密碼改一下。

IP 改了,要重灌,先移除。然後執行上面的指令,重裝。

rpm -e openvpn-as

裝好後,只要把使用者加上,預設用 NAT 模式,就可以用了。

用這個更快吧,只要有 VMware 就可以用,不過,已經在 CentOS 裝好了,就不試了。

OpenVPN Access Server Virtual Appliance VMware Version