Below you will find pages that utilize the taxonomy term “OpenVPN”
透过OpenVPN建立IPv4/IPv6隧道
本文只是给自己的手记,内容散乱很难读懂。如需帮助,请留言。
最近Linode优惠活动很多,内存翻倍了,硬盘也翻倍了,比AWS啦,RackSpace啦便宜多了~
于是乎,直接付了一年的款,还优惠了10% 🙂
因为Linode是可以通过发ticket申请到/56的IPv6地址的,因此我就在Linode上搭了一个OpenVPN服务器,和实验室的OpenWRT路由连起来,提供IPv4/IPv6隧道。
OpenVPN有两种工作模式,tun和tap。tun工作在三层,tap在二层。tun模式对IPv6的支持是最近才完善的,不晓得能否可以用于这种环境(在路由器上配置隧道,通过路由向客户端提供类似于原生双栈接入的体验,而无需在客户端电脑上安装任何附加软件或进行特殊配置)。
tap模式的配置方法是我自己摸索出来的。由于tap是二层设备,所以隧道打通之后,可以认为OpenVPN服务器端的tap0和OpenVPN客户端的tap0设备是插在同一个交换机上的两张网卡。具体上面跑什么,自己弄就好了。不过,似乎OpenVPN存在某种限制(来源请求),必须在隧道双方的tap设备上配置一个IPv4地址,否则只配置IPv6地址会导致隧道打不通。
服务器端配置文件(/etc/openvpn/server.conf)如下(从/usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz抄的):
#################################################
# Sample OpenVPN 2.0 config file for #
# multi-client server. #
# #
# This file is for the server side #
# of a many-clients one-server #
# OpenVPN configuration. #
# #
# OpenVPN also supports #
# single-machine single-machine #
# configurations (See the Examples page #
# on the web site for more info). #
# #
# This config should work on Windows #
# or Linux/BSD systems. Remember on #
# Windows to quote pathnames and use #
# double backslashes, e.g.: #
# “C:\\Program Files\\OpenVPN\\config\\foo.key” #
# #
# Comments are preceded with ‘#’ or ‘;’ #
#################################################