5月 182012
 

注意到 BadVPN 是一個以 C 开发的开源点对点协议的 VPN 系统. 它在 VPN 节点间工作于第二层乙太网协议上. 目前节点需要连接一个作为聊天服务器的中心服务器, 中心服务器帮助节点之间建立数据直连. 直连用于传输加密过的网络数据.

目前 BadVPN 提供 Linux 版和 Windows 版下载, 作者认为在 FreeBSD 上应该也能工作.

7月 312011
 

巴基斯坦开始执行新的电信法(PDF),要求ISP监视用户的网络使用。毫无疑问,加密将让监视变得困难重重。因此巴基斯坦正试图禁止用户使用加密,其中包括VPN。这条消息是隐私保护组织隐私国际(Privacy International)通过其Twitter帐号报导的。

6月 022011
 

  虚拟专用网络(VPN)已经成为了公司合作伙伴或员工远程安全访问公司资源的事实标准。在本文中,我们将试图解释两种特定的VPN类型,即IPSec VPN和SSL VPN,以及这两种类型应该如何选择。

  然而,在深入研究这两个不同类型之前,需要首先对VPN技术进行一个简要的概述。VPN是指有利于远程访问公司资源的一系列技术。这种技术的主要用户,是试图在家或者其他公共场所访问公司资源的公司雇员,以及在公司的基础架构内支持各种系统的合作伙伴或第三方。VPN一般通过在远程站点和公司网络之间建立一个加密通道的方式,利用公共长途IP网络来进行数据传输,这些远程站点包括雇员的笔记本电脑或者第三方系统。 Continue reading »

12月 032010
 

前一段时间参照这篇在Ubuntu上搭建OpenVPN服务器,并配合Mac和Windows的客户端 (一)在自己的 VPS 上装好 OpenVPN 服务器后使用一直不太正常,这两天花了点时间调试解决,结果总结如下。调试期间多次得到 @yegle @ChandleWEi @Greendamn 和 @FretiaX 等推友的帮助,尤其是 @ChandleWEi 深夜还在我家现场调试 iptables,特此感谢。

MTU 太大造成的连接不稳定

症状
刚连接上 OpenVPN 只用浏览器打开一两个页面时速度很正常,但随着流量加大网络就会开始阻塞,直到完全无法连接任何服务器。而且与 OpenVPN 服务器之间的连接容易自动断开。

解决方案
在 OpenVPN 服务器的 server.conf 里加入 mssfix 1300。此方案由 @yegle 提供。数字应该是他多次测试得出的较优选择,我试过设为 mssfix 1400 自己的 PC 没问题,而朋友的机器会速度奇慢。

DNS 污染造成的部分墙外网站无法访问

症状
连接 OpenVPN 后 Twitter 可以正常访问,被严重 DNS 污染的 Facebook 则会被浏览器提示无法连接。

解决方案
在 OpenVPN 服务器上使用 iptables 强行劫持客户端对任何 DNS 服务器的查询请求,将请求的目标 IP 地址修改为墙外的 DNS 服务器,例如 Google 的公共 DNS 服务器 8.8.8.8 和 8.8.4.4。此方案参照 @yegle 的方案稍作修改,不需要 OpenVPN 服务器自己提供 DNS 服务。iptables 命令如下:

iptables -t nat -A PREROUTING -p udp –dport 53 -j DNAT –to-destination 8.8.8.8 Continue reading »

12月 032010
 

作者:fqvpn

之前有一个用户抱怨说OpenVPN 不稳定,不定时的断,而且断了之后还不能自动重新连上。 经过调试发现是客户端配置文件中的persist-tun 配置项的问题。 OpenVPN 手册中的说明如下

–persist-tun
Don’t close and reopen TUN/TAP device or run up/down scripts across SIGUSR1 or –ping-restart restarts.

SIGUSR1 is a restart signal similar to SIGHUP, but which offers finer-grained control over reset options.

Windows 下面的客户端如果指定了这个配置项,会导致断线之后 (比如承载OpenVPN 的实际网络比如Wifi或者PPPoE断线)。
断线之后服务器端在一段时候内没有收到客户端的Keep-Alive 包, 认为客户端断线,中断连线。
当网络恢复的时候,客户端发现服务器端没有响应了(因为服务器关闭连接了), 重启自己的进程。 当有 persist-tun 选项时,它会重用之前的TUN/TAP 设备, 但是很奇怪它没有取重新认证,然后就一直卡在哪里,托盘图标一直时黄色的。 将persisit-tun 选项去掉之后,就能马上自动连上了。

12月 012010
 

Overview

OpenVPN is a full-featured open source SSL VPN solution that accommodates a wide range of configurations, including remote access, site-to-site VPNs, Wi-Fi security, and enterprise-scale remote access solutions with load balancing, failover, and fine-grained access-controls. Starting with the fundamental premise that complexity is the enemy of security, OpenVPN offers a cost-effective, lightweight alternative to other VPN technologies that is well-targeted for the SME and enterprise markets.

OpenVPN combines security with ease-of-use

OpenVPN's lightweight design sheds many of the complexities that characterize other VPN implementations. The OpenVPN security model is based on SSL, the industry standard for secure communications via the internet. OpenVPN implements OSI layer 2 or 3 secure network extension using the SSL/TLS protocol, supports flexible client authentication methods based on certificates, smart cards, and/or 2-factor authentication, and allows user or group-specific access control policies using firewall rules applied to the VPN virtual interface. OpenVPN is not a web application proxy and does not operate through a web browser.

What is OpenVPN?

With OpenVPN, you can:

    * tunnel any IP subnetwork or virtual ethernet adapter over a single UDP or TCP port,
    * configure a scalable, load-balanced VPN server farm using one or more machines which can handle thousands of dynamic connections from incoming VPN clients,
    * use all of the encryption, authentication, and certification features of the OpenSSL library to protect your private network traffic as it transits the internet,
    * use any cipher, key size, or HMAC digest (for datagram integrity checking) supported by the OpenSSL library,
    * choose between static-key based conventional encryption or certificate-based public key encryption,
    * use static, pre-shared keys or TLS-based dynamic key exchange,
    * use real-time adaptive link compression and traffic-shaping to manage link bandwidth utilization,
    * tunnel networks whose public endpoints are dynamic such as DHCP or dial-in clients,
    * tunnel networks through connection-oriented stateful firewalls without having to use explicit firewall rules,
    * tunnel networks over NAT,
    * create secure ethernet bridges using virtual tap devices, and
    * control OpenVPN using a GUI on Windows or Mac OS X. Continue reading »

12月 012010
 

2010-10-24

笔者(66ip.com)在实践中遇到OPENVPN变慢,以及掉包的现像.在网络上也有许多人询问,但多无明确的答复.现根据研究略作分析.

1 为什么会掉包?
根本原因是由于网络连接质量较差.
当ICMP报文封装成IP数据报,再封装成帧在网络上传输时,由于帧的丢失导致掉包.

2 为什么将UDP改成TCP掉包会减少?
网上许多人答复掉包的解决方案是换用TCP协议.在下测试时,发现换用TCP协议的确使掉包减少了。
原因分析:
ICMP报文封装成IP数据报,此数据报传输在虚拟的VPN线路上。
当OPENVPN使用UDP协议时,虚拟的VPN线路是基于UDP协议的,ICMP本身并无什么差错控制功能,UDP也是一个无连接、不可靠的协议,所以线路质量不佳时就易表现为掉包。
当OPENVPN改用TCP协议时,虚拟的VPN线路是基于TCP协议的,TCP协议是有连接的、可靠的协议,有较强的差错控制、流量控制、拥塞控制功能,故虽然也会有帧丢失,但TCP协议本身进行了对出错的TCP报文段进行了重发,故掉包会得到抑制。

3 为什么UDP改成TCP后PING值会增加,下载速度会减慢?
经66ip.com测试,UDP改成TCP后,使得ping值严重增加,此时测试下载速度会较使用UDP协议有很大的下降.
原因分析:
改用TCP后,与使用UDP相比,丢帧的程度是差不多的,TCP以大量的重发来弥补丢帧,所以PING值会增加,下载速度会减慢。非常有趣的是,PING值会表现得很不稳定。

4 将UDP协议改成TCP是解决掉包的好主意吗?
不是. Continue reading »

11月 292010
 

Protocol Security Summary
by Peter Mueller

PPTP is known to be a faulty protocol. The designers of the protocol, Microsoft, recommend not to use it due to the inherent risks. Lots of people use PPTP anyway due to ease of use, but that doesn't mean it is any less hazardous. The maintainers of PPTP Client and Poptop recommend using OpenVPN (SSL based) or IPSec instead.

(Posted on 2005-08-10 to the mailing list)

Why not use PPTP?
by James Cameron

The point to point tunneling protocol (PPTP) is not secure enough for some information security policies.

It's the nature of the MSCHAP V2 authentication, how it can be broken trivially by capture of the datastream, and how MPPE depends on the MSCHAP tokens for cryptographic keys. MPPE is also only 128-bit, reasonably straightforward to attack, and the keys used at each end are the same, which lowers the effort required to succeed. The obvious lack of two-factor authentication, instead relying on a single username and password, is also a risk. The increasing use of domestic wireless systems makes information capture more likely.

However, that doesn't mean people don't accept the risks. There are many corporations and individuals using PPTP with full knowledge of these risks. Some use mitigating controls, and some don't. Continue reading »