快速业务通道

搭建Openvpn初尝试

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-03-28
de) [CN]:CN
State or Province Name (full name) [BJ]:BJ
Locality Name (eg, city) [BJ]:BJ
Organization Name (eg, company) [OpenVPN-TEST]:bokee
Organizational Unit Name (eg, section) []:blogchina
Common Name (eg, your name or your server''s hostname) []:bokee-inc.com
Email Address [wjpheart@126.com]:

Please enter the following ''extra'' attributes
to be sent with your certificate request
A challenge password []:wjpinrain 拥有帝国一切,皆有可能。欢迎访问phome.net
An optional company name []:bokee
Using configuration from /home/weijunping/openvpn-2.0.9/easy-rsa/openssl.cnf
Check that the request matches the signature
Signature ok
The Subject''s Distinguished Name is as follows
countryName :PRINTABLE:''CN''
stateOrProvinceName :PRINTABLE:''BJ''
localityName :PRINTABLE:''BJ''
organizationName :PRINTABLE:''bokee''
organizationalUnitName:PRINTABLE:''blogchina''
commonName :PRINTABLE:''bokee-inc.com''
emailAddress :IA5STRING:''wjpheart@126.com''
Certificate is to be certified until Sep 12 03:40:48 2021 GMT (3650 days)
Sign the certificate? [y/n]:y


1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
[root@localhost easy-rsa]#
[root@localhost easy-rsa]# 建立 Diffie Hellman 参数
[root@localhost easy-rsa]# ./build-dh
Generating DH parameters, 1024 bit long safe prime, generator 2
This is going to take a long time
....... ........................................................... ............................... .. .. ...................

............. ........................................................................................... .................... ............................................................... .................. ...................................... ................... ....................... ...... * * *
4、创建服务端配置文件
#mkdir /usr/local/openvpn/etc/
[root@localhostopenvpn]#cd /home/weijunping/openvpn-2.9/sample-config-files/
[root@localhost sample-config-files]# cp server.conf /usr/local/openvpn/etc/
[root@localhost sample-config-files]# vi /usr/local/openvpn/etc/server.conf
编辑后的server.conf文件内容如下: 拥有帝国一切,皆有可能。欢迎访问phome.net
port 1194
proto udp
dev tun
ca /home/weijunping/openvpn-2.0.9/easy-rsa/keys/ca.crt
cert /home/weijunping/openvpn-2.0.9/easy-rsa/keys/server.crt
key /home/weijunping/openvpn-2.0.9/easy-rsa/keys/server.key
dh /home/weijunping/openvpn-2.0.9/easy-rsa/keys/dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway"
push "dhcp-option DNS 202.106.0.20" (指定DNS服务器的地址)
client-to-client
keepalive 10 120
comp-lzo
max-clients 100
user nobody
group nobody
persist-key
persist-tun
status /home/weijunping/openvpn-2.0.9/easy-rsa/keys/openvpn-status.log
verb 4
5、部署server端key文件
#mkdir /usr/local/openvpn/etc/keys
#cd /home/weijunping/openvpn-2.0.9

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多
上一篇: Linux分区下一篇: 追梦的孩子

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号