debian 6 openvpn
- font size decrease font size increase font size
1:安装apt-get install openvpn iptables
2:配置服务端
cp -R /usr/share/doc/openvpn/examples/easy-rsa /etc/openvpn
cd /etc/openvpn/easy-rsa/2.0
chmod +x vars
source ./vars
./clean-all
./build-ca
这一步,您一直回车就行,不要填密码,如果要求你回答Y还是N,选Y回车
./build-key-server server
./build-key client1
这2步也跟上面一样,一路回车和选择Y回车
./build-dh
3:配置转发vi /etc/rc.local
添加以下语句,您只要替换“208.110.73.134”为您自己的ip就行# add iptables rule for openvpn
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o venet0 -j SNAT --to 208.110.73.134
4:增加服务器端conf文件vi /etc/openvpn/openvpn.conf
增加如下内容dev tun
proto tcp
port 1194
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
user nobody
group nogroup
server 10.8.0.0 255.255.255.0
persist-key
persist-tun
#status openvpn-status.log
#verb 3
client-to-client
push “redirect-gateway def1″
push “dhcp-option DNS 69.197.153.253″
push “dhcp-option DNS 69.30.192.15″
comp-lzo
ok,启动openvpn服务/etc/init.d/openvpn start
nohup /etc/rc.local &
5:客户端安装配置
到 http://openvpn.net/index.php/open-source/downloads.html 下载winodws客户端
安装后,然后从服务器把以下3个文件拷贝到windows安装路径下的config目录
这3个文件分别是/etc/openvpn/easy-rsa/2.0/keys/ca.crt
/etc/openvpn/easy-rsa/2.0/keys/client1.crt
/etc/openvpn/easy-rsa/2.0/keys/client1.key
6:增加客户端配置文件
在config增加一个配置文件,文件名为client.ovpn
内容如下:client
dev tun
proto tcp
# The hostname/IP and port of the server.
# CHANGE THIS TO YOUR VPS IP ADDRESS
remote 208.110.73.134 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client1.crt
key client1.key
comp-lzo
verb 3
File excerpt:/etc/sysctl.conf
net.ipv4.ip_forward=1
Issue the following command to set this variable for the current session:
echo 1 > /proc/sys/net/ipv4/ip_forward
( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0009 | 405056 | {main}( ) | .../index.php:0 |
2 | 0.0548 | 1323096 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0548 | 1323096 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.1970 | 2981440 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.1976 | 3005784 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.1982 | 3061112 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.1983 | 3078168 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.2044 | 3222256 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.2044 | 3222256 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.2097 | 3491336 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.2097 | 3491336 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.2107 | 3509856 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.2130 | 3530272 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.2557 | 4076000 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.2557 | 4076000 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.2582 | 4250720 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |
- Published in Openvpn
- Read 1723 times
( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0009 | 405056 | {main}( ) | .../index.php:0 |
2 | 0.0548 | 1323096 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0548 | 1323096 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.1970 | 2981440 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.1976 | 3005784 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.1982 | 3061112 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.1983 | 3078168 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.2044 | 3222256 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.2044 | 3222256 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.2097 | 3491336 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.2097 | 3491336 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.2107 | 3509856 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.2130 | 3530272 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.2557 | 4076000 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.2557 | 4076000 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.2582 | 4250720 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |