OpenVPN 通过服务器上网

时间:2022-01-01 19:51:22

在Windows环境中架设OpenVPN服务相对比较简单,网上这方面的教程也比较丰富,照葫芦画瓢即可。但是大部分教程都只讲了如何将client与Server通过VPN管道连接起来,使client可以正常访问Server所在的内部网络(这也是VPN的主要应用)。而现实情况中往往有一种需求,就是client需要通过server来访问Internet,即server作为Proxy,对client访问Internet的数据进行转发。互联网上大部分收费的VPN代理都是以这样的方式实现。

那么在OpenVPN中,要怎么实现呢?

OpenVPN 2.3.4 I003/I603 下载地址

Installer (32-bit), Windows XP and later http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.4-I003-i686.exe

Installer (64-bit), Windows XP and later http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.4-I003-x86_64.exe

Installer (32-bit), Windows Vista and later http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.4-I603-i686.exe

Installer (64-bit), Windows Vista and later http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.4-I603-x86_64.exe

Source Tarball (gzip) http://swupdate.openvpn.org/community/releases/openvpn-2.3.4.tar.gz

Source Tarball (xz) http://swupdate.openvpn.org/community/releases/openvpn-2.3.4.tar.xz

Source Zip http://swupdate.openvpn.org/community/releases/openvpn-2.3.4.zip

OpenVPN 2.3.4 I002 下载地址(已修复心脏出血漏洞)

Windows Install 32-bit http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.4-I002-i686.exe

Windows Install 64-bit http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.4-I002-x86_64.exe

Source-zip http://swupdate.openvpn.org/community/releases/openvpn-2.3.4.zip

Source-gzip http://swupdate.openvpn.org/community/releases/openvpn-2.3.4.tar.gz

Source-xz http://swupdate.openvpn.org/community/releases/openvpn-2.3.4.tar.xz

OpenVPN 2.3.3  下载地址

32位 http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.3-I002-i686.exe

64位 http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.3-I002-x86_64.exe

源代码 http://swupdate.openvpn.org/community/releases/openvpn-2.3.3.zip

OpenVPN 2.3.2 下载地址

32Bit http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.2-I001-i686.exe

64Bit http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.2-I001-x86_64.exe

Source Code http://swupdate.openvpn.org/community/releases/openvpn-2.3.2.zip

OpenVPN 2.3 下载地址

32位 http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.0-I005-i686.exe

64位 http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.0-I005-x86_64.exe

源代码 http://swupdate.openvpn.org/community/releases/openvpn-2.3.0.zip

OpenVPN 2.2 下载地址

下安装程序:http://swupdate.openvpn.org/community/releases/openvpn-2.2.2-install.exe

源代码:http://swupdate.openvpn.org/community/releases/openvpn-2.2.2.zip

安装说明在

http://www.cnblogs.com/irisrain/p/4202046.html

一、首先,完成OpenVPN server端与client端的安装与配置。

server配置如下:

# 监听地址

local 0.0.0.0

# 监听端口

port 1194

# 使用TCP或UDP协议

proto tcp

;proto udp

# 使用TAP或TUN模式

dev tap

;dev tun

# 加密认证

ca ca.crt

cert server.crt

key server.key

dh dh1024.pem

# VPN子网

server 10.8.0.0 255.255.255.0

# 路由设置

push "route 0.0.0.0 0.0.0.0"

# 设置网关转发

push "redirect-gateway def1 bypass-dhcp"

# 设置dhcp DNS

push "dhcp-option DNS 114.114.114.114"

push "dhcp-option DNS 8.8.8.8"

ifconfig-pool-persist ipp.txt

duplicate-cn

keepalive 10 120

comp-lzo

persist-key

persist-tun

status openvpn-status.log

verb 3

client配置如下:

client

# 使用TAP或TUN模式

dev tap

;dev tun

# 使用TCP或UDP协议

proto tcp

;proto udp

# server地址端口

remote x.x.x.x 1194

# 加密认证

ca ca.crt

cert client.crt

key client.key

ns-cert-type server

persist-key

persist-tun

comp-lzo

verb 3

要使client通过server连接Internet,则在设置中要注意:

1、使用TAP模式;

2、加入路由设置

push "route 0.0.0.0 0.0.0.0"

3、设置网关转发并设置DNS

push "redirect-gateway def1 bypass-dhcp"

push "dhcp-option DNS 114.114.114.114"

push "dhcp-option DNS 8.8.8.8"

设置完成,client正常连接server后,使用ipconfig应该能正常看到VPN网关地址,并且能够ping通VPN网关。

二、在Server端,配置好VPN 开启NAT。

OpenVPN 通过服务器上网的更多相关文章

  1. 通过f5的默认路由使服务器上网

    1.通过f5的默认路由使服务器上网 1)将服务器的默认网关指到f5的floating ip 2)f5上配置

  2. openvpn 连接无法上网

    环境:搬瓦工的vps,centos6,搬瓦工附带的openvpn服务端: 出现的问题:正常启动openvpn客户端,也正常连接服务器,但是连接之后就是没有办法上网: 我的解决办法:打开ip forwa ...

  3. 通过OpenVPN来穿越上网(未实践)

    说明: 1.其实OpenVPN可以通过其实现穿越来上网,即全部请求都经过OpenVPN来处理.其原理是iptables转发.如果全程走iptables也是可以的,网上的教程基本都是基于iptables ...

  4. 使用Dnsmasq搭建本地dns服务器上网

    导读 搭建一个属于自己的本地DNS服务器很有必要,利用Dnsmasq来搭建一个属于自己的本地DNS服务器,享受更干净无污染.更智能快速和没有广告干扰的DNS解析服务. 一.Dnsmasq安装 安装并启 ...

  5. 在Ubuntu14.04上搭建自己的OpenVPN服务器并通过它上网

    背景 学校宿舍端口可以配置静态IP连校内网,也可以连到实验室的服务器:实验室的服务器可以连外网:但宿舍要连外网就要花钱买PPPoE账号了.作为壮哉我大计院的一员,本着发扬专(neng)业(sheng) ...

  6. 利用OpenVPN实现局域网内多台机器共享上网

    本文转载自 https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-14- ...

  7. 绕过校园网的共享限制 win10搭建VPN服务器实现--从入门到放弃

    一.开篇立论= =.. 上次说到博主在电脑上搭建了代理服务器来绕过天翼客户端的共享限制,然而经过实际测试还不够完美,所以本着生命不息,折腾不止的精神,我又开始研究搭建vpn服务器= =... (上次的 ...

  8. WIN2003 设置 OPENVPN 服务端

    服务器端 安装openvpn 在这里http://swupdate.openvpn.org/community/releases/openvpn-install-2.3.4-I004-i686.exe ...

  9. Linux安装配置VPN服务器

    一.实验简介 VPN ,中文翻译为虚拟专有网络,英文全称是 Virtual Private Network .现在 VPN 被普遍定义为通过 一个公用互联网络建立一个临时的.安全的连接,是一条穿过混乱 ...

随机推荐

  1. 【maven】maven创建web项目-pom文件提示web.xml is missing and <failOnMissingWebXml> is set to true

    使用maven创建web项目,选择war类型后,pom文件红叉 提示web.xml is missing and <failOnMissingWebXml> is set to true ...

  2. front-end plugin&comma; generate pdf with html5 and jquery

    http://www.jqcool.net/jquery-jspdf.html[from this site] <html> <head></head> <s ...

  3. java 处理xml格式数据

    1.单个xml文件 package lia.meetlucene; import java.io.*; import javax.xml.parsers.DocumentBuilder; import ...

  4. Cygwin环境编译&sol;usr&sol;include&sol;sys&sol;&lowbar;types&period;h&colon;72&colon;20&colon; 致命错误:stddef&period;h:can not found

    环境介绍: win7_x64 +Cygwin64 gcc :4.8.2 g++:4.8.1 编译 c++的helloworld.cpp 一直失败! 代码如下: #include <iostrea ...

  5. 雕爷牛腩这样判断零售未来-搜狐IT

    雕爷牛腩这样判断零售未来-搜狐IT 雕爷牛腩这样判断零售未来

  6. 【译文】什么是Docker

    What is Docker? By Tim Butler • 14 May 2015 • https://www.conetix.com.au/blog/what-is-docker Unless ...

  7. kotlin成长之路

    前言: 从接触Kotlin开始,也就是我今天开启写技术博客的决定,文采不佳,欢迎各位阅读者的理解与指点.而该篇文章是最为博客新手的我对Kotlin成长的引导篇,所以内容一般是Kotlin技术博客的目录 ...

  8. 查看windows、linux的SN

     gwmi win32_bios    [root@live-al-ops-pxe-2 ~]# dmidecode | grep Number | sed -n '1p' Serial Number: ...

  9. css实现多行文本溢出显示省略号&lpar;…&rpar;全攻略

    省略号在ie中可以使用text-overflow:ellipsis了,但有很多的浏览器都需要固定宽度了,同时ff这些浏览器并不支持text-overflow:ellipsis设置了,下文来给各位整理一 ...

  10. windows下pip安装python模块时报错

    windows下pip安装python模块时报错总结  装载于:https://www.cnblogs.com/maxaimee/p/6515165.html 前言: 这几天把python版本升级后, ...