« 升了内核 | Main | life is hard »
January 5, 2004
OpenVPN 新一代的领军旗舰 前进方向的代表
|
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。 https://windtear.net/archives/2004/01/05/000455.html http://windtear.net/archives/2004/01/05/000455.html
看了 FreeWizard 昨天的文章后
就认真去看了看 openvpn
真的是好东西啊 呵呵
发信人: windtear (love you love me 因为有你 冬天不再寒冷), 信区: LinuxDev
标 题: Re: OpenVPN相关配置
发信站: BBS 水木清华站 (Sun Jan 4 14:03:00 2004), 转信
刚才去主页看了看
这个真是好东西啊
记得去年夏天有人还问
当时他做的调研是
1是有linux下的vtun
2是有深圳一家公司做的客户端
当时 openvpn 还不支持 windows 呵呵
http://www.linuxsecurity.com/feature_stories/feature_story-152.html
这篇文章可以看看
OpenVPN: An Introduction and Interview with Founder, James Yonan
In this article, Duane Dunston gives a brief introduction to OpenVPN
and interviews its founder James Yonan.
用户的评价、推荐
http://openvpn.sourceforge.net/testimonials.html
然后就是代码、文档了
把URL地址拷过来了
(补注:官方网站新网址 http://openvpn.net/)
http://openvpn.sourceforge.net/
http://www.oberhumer.com/opensource/lzo/
http://prdownloads.sourceforge.net/openvpn/openvpn-1.5.0.tar.gz
http://www.oberhumer.com/opensource/lzo/download/lzo-1.08.tar.gz
http://prdownloads.sourceforge.net/openvpn/openvpn-1.5.0.zip
http://prdownloads.sourceforge.net/openvpn/openvpn-1.5.0-install.exe
发信人: windtear (love you love me 因为有你 冬天不再寒冷), 信区: LinuxDev
标 题: Re: OpenVPN相关配置
发信站: BBS 水木清华站 (Sun Jan 4 17:03:04 2004), 转信
速度我没太注意 应该比 pptpd 快吧 openvpn默认采用 udp 应该不比 pptpd 差
负载还行
lzo 的效果暂时还没法看
我的个人看法 lzo 在机器太破时反而不好 parker 有个网友修改的 lzo 版本 太累:(
我拿你的脚本生成配置跑的 也是基于 static key 的认证
这样的话只能 port<->user 对应
可以做的就是 结合数据库 CGI 服务器监控脚本(key conf email)实现用户管理等
你的脚本如果用 bash 的话
expr 可以换成 let
let "ouid += 1"
let "PORT = $BASE_PORT + 1"
mtu 一般不用太在意
我没试不通过GRE的 NAT 后的情况
各种级联应该很简单吧
希望比 windows 的 RRAS 强
也许比 pptpd/ppp 也要强不少
比 tunnel 应该是比不上
不过 openvpn 对 proxy 的支持比较不错 呵呵
【 在 FreeWizard (求放心 | Pray4u ) 的大作中提到: 】
: good
: 交流一下我遇到的几个问题
: 协议的固有缺陷 速度比直接联慢一些 lzo也不会有太大的效果
: 目前看来必须为每个连接分配一个port 最好再有一个控制协议方便验证和分配
: ip
: 不知道是不是我mss mtu这些都没仔细配置 经常会有莫名的呆住
: 先写这么多 晚上还有考试 你们吃得愉快
------------------------------------------------------
linux:
安装 lzo
安装 openvpn
用 freewizard 的脚本生成 conf key
tar zxvf lzo-1.08.tar.gz
tar zxvf openvpn-1.5.0.tar.gz
mkdir -p /dev/net/
mknod /dev/net/tun c 10 200
echo "alias char-major-10-200 tun" >> /etc/modules.conf
modprobe tun
lsmod
cd lzo-1.08
./configure
make
make check
make test
make install
cd ../openvpn-1.5.0
./configure
make
make install
mkdir -p /etc/openvpn
chmod 700 /etc/openvpn/
cp -a sample-scripts/openvpn.init /etc/rc.d/init.d/openvpn
chkconfig --add openvpn
chkconfig --list
openvpn --genkey --secret key
openvpn --test-crypto --secret key
openvpn --config sample-config-files/loopback-client
#another window
openvpn --config sample-config-files/loopback-server
vi /usr/share/ssl/openssl.cnf
openssl req -nodes -new -x509 -keyout my-ca.key -out my-ca.crt -days 3650
openssl req -nodes -new -keyout office.key -out office.csr
openssl req -nodes -new -keyout office.key -out office.csr
#openssl ca -out office.crt -in office.csr
openssl req -nodes -new -keyout home.key -out home.csr
openssl req -nodes -new -keyout home.key -out home.csr
openssl dhparam -out dh1024.pem 1024
#static
openvpn --genkey --secret static.key
cat > /sbin/openvpn-route
cat > /sbin/openvpn-deluser
cat > /sbin/openvpn-adduser
chmod 755 /sbin/openvpn-*
openvpn-adduser windtear
cd /etc/openvpn
more ovpasswd
more windtear.conf
more windtear.okey
openvpn --cd /etc/openvpn/ --daemon --config windtear.conf
ps axf
netstat -nlp
iptables -t nat -nvL
iptables -t nat -A POSTROUTING -s 10.28.168.0/24 -j MASQUERADE
top -p 6990
ifconfig tap0
windows:
安装 openvpn (选择安装 tap)
重起
copy 生成的 okey ovpn
net start openvpnservice
route add ... mask ... ...
|
Posted by windtear at January 5, 2004 12:40 AM