安裝openvpn
3.1 server
# 安裝 lzo
在网站上下载lzo*.tar.gz的包
tar -zxvf lzo*.tar.gz
cd lzo*
./configure
make && make install
# 安裝 openvpn
cd /usr/local/src
wget http://openvpn.net/release/openvpn-2.0.9.tar.gz
tar -zxvf openvpn-2.0.9.tar.gz
cd openvpn-2.0.9
./configure
make && make install
# 复制设定规范
cp -r /usr/local/src/openvpn-2.0.9/ /etc/openvpn/
cp -r /usr/local/src/openvpn-2.0.9/sample-config-files/server.conf /etc/openvpn/
# 设定 CA 环境
cd /etc/openvpn/easy-rsa/ //当然你也可以不写
vi vars
export KEY_COUNTRY=TW
export KEY_PROVINCE=Taiwan
export KEY_CITY=Tainan
export KEY_ORG="Study-Area"
export KEY_EMAIL="netman@study-area.org"
. ./vars
./clean-all
# 建立 root CA
./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) [TW]:
State or Province Name (full name) [Taiwan]:
Locality Name (eg, city) [Tainan]:
Organization Name (eg, company) [Study-Area]:
Organizational Unit Name (eg, section) []:test
Common Name (eg, your name or your server''s hostname) []:CA
Email Address [netman@study-area.org]:
# 建立 server key 及 crt
./build-key-server S1
Generating a 1024 bit RSA private key
............................
....
writing new private key to ''ovpnsrv1.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) [TW]:
State or Province Name (full name) [Taiwan]:
Locality Name (eg, city) [Tainan]:
Organization Name (eg, company) [Study-Area]:
Organizational Unit Name (eg, section) []:test
Common Name (eg, your name or your server''s hostname) []:ovpnsrv1
Email Address [netman@study-area.org]:
Please enter the following ''extra'' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Using configuration from /etc/openvpn/easy-rsa/openssl.cnf
Check that the request matches the signature
Signature ok
The Subject''s Distinguished Name is as follows
countryName :PRINTABLE:''TW''
stateOrProvinceName :PRINTABLE:''Taiwan''
localityName :PRINTABLE:''Tainan''
organizationName :PRINTABLE:''Study-Area''
organizationalUnitName:PRINTABLE:''tes |