一、软件的安装
1、切换目录
# cd /usr/local/src
2、Linux 服务器端软件
#wget http://openvpn.net/release/openvpn-2.0.9.tar.gz
#wget http://openvpn.net/release/lzo-1.08-4.rf.src.rpm (建议安装,压缩后可提供传输速度)
3、Windows 客户端软件
http://www.openvpn.se/files/install_packages/openvpn-2.0.9-gui-1.0.3-install.exe
4、安装对应的库文件
#yum install rpm-build
#yum install autoconf.noarch
#yum install zlib-devel
#yum install pam-devel
#yum install openssl-devel
5、安装lzo和openvpn软件
#rpmbuild --rebuild lzo-1.08-4.rf.src.rpm
#rpm -Uvh /usr/src/redhat/RPMS/i386/lzo-*.rpm
#rpmbuild -tb openvpn-2.0.9.tar.gz
#rpm -Uvh /usr/src/redhat/RPMS/i386/openvpn-2.0.9-1.i386.rpm
6、复制配置文件
#cp -r /usr/share/doc/openvpn-2.0.9/easy-rsa/ /etc/openvpn/
#cp /usr/share/doc/openvpn-2.0.9/sample-config-files/server.conf /etc/openvpn/
7、配置证书
#cd /etc/openvpn/easy-rsa/
#vi vars
翻滚到页面底端,按需要修改以下参数:
export KEY_COUNTRY=CN
export KEY_PROVINCE=SHANGHAI
export KEY_CITY=SHANGHAI
export KEY_ORG=”VPN-TEST”
export KEY_EMAIL=”[email]name@email.com[/email]”
#. ./vars (中间有个空格 . . )
#./clean-all
8、创建证书
#./build-ca
Generating a 1024 bit RSA private key
………………………++++++
…………………….++++++
writing new private key to ‘ca.key’
—–
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [CN]:
State or Province Name (full name) [SHANGHAI]:
Locality Name (eg, city) [SHANGHAI]:
Organization Name (eg, company) [VPN-TEST]:
Organizational Unit Name (eg, section) []:123456
Common Name (eg, your name or your server’s hostname) []:host3721.com
Email Address [name@mail.com]:
有些信息在第7步,已经有了,照填即可。