由 tiger2008 在 08-29-2002 19:45 发表:
有沒有linux下作vpn成功案例
我想用一台linux作vpn server﹐讓出差在外的員工能利用internet通過這台vpn server連入公司內部網入進行資料存取﹗
由 北南南北 在 08-29-2002 21:59 发表:
Linux下VPN的PPTP连接HOWTO
作者:mad_dog [[email protected]]
来自:oldhand.org
--------------------------------------------------------------------------------
2002-03-25 09:55 oldhand.org mad_dog
1.下载ppp-mppe-2.4.0-4.tar.gz(pppd的补丁版),pptp-linux-1.0.3-1.tar.gz
(pptp客户端),假定下载文件放在/opt下
2.安装
解压缩、安装pppd2.4.0
cd /opt
tar zxvf ppp-mppe-2.4.0-4.tar.gz -C /opt
cd /opt/ppp-mppe-2.4.0-4
sh unpack.sh ;执行这个脚本,给pppd打patch
cd ppp-2.4-0
./configure
make
mv /usr/sbin/pppd /usr/sbin/pppd.old ;原来的pppd做个备份
cp pppd /usr/sbin/pppd ;将新的pppd放入系统路径
解压缩、安装pptp-linux
cd /opt
tar zxvf pptp-linux-1.0.3-1.tar.gz -C /opt
cd /opt/pptp-linux-1.0.3-1
cp options.pptp /etc/ppp/
mkdir /etc/pptp.d/ ; 这一步不做也可以
tar zxvf pptp-linux-1.0.3.tar.gz
cd pptp-linux-1.0.3
make
cp pptp /usr/sbin
cp pptp-callmgr /usr/bin
3. 设置
cd /opt/pptp-linux-1.0.3-1
./pptp-command
1.) start
2.) stop
3.) setup
4.) quit
What task would you like to do?:3
选3,设置
1.) List CHAP secrets
2.) Add a New CHAP secret
3.) Delete a CHAP secret
4.) List PPTP Tunnels
5.) Add a NEW PPTP Tunnel
6.) Delete a PPTP Tunnel
7.) Configure resolv.conf
8.) Select a default tunnel
9.) Quit
?:2 ;先建立一个CHAP secrets,选择2
Add a NEW CHAP secret.
NOTE: Any backslashes (\) must be doubled (\\).
Local Name:
This is the 'local' identifier for CHAP authentication.
NOTE: If the server is a Windows NT machine, the local name
should be your Windows NT username including domain.
For example:
domain\\username
Local Name:pptp ;这里填上pptp的登录用户名称,然后出现
Remote Name:
This is the 'remote' identifier for CHAP authentication.
In most cases, this can be left as the default. If must be
set if you have multiple CHAP secrets with the same local name
and different passwords. Just press ENTER to keep the default.
Remote Name [PPTP]: ;用默认的PPTP就行,所以,回车进入下一项
Password:
This is the password or CHAP secret for the account specified. The
password will not be echoed.
Password: ;在这里敲入密码,密码不回显
回到主选单
Adding secret pptp PPTP *****
1.) List CHAP secrets
2.) Add a New CHAP secret
3.) Delete a CHAP secret
4.) List PPTP Tunnels
5.) Add a NEW PPTP Tunnel
6.) Delete a PPTP Tunnel
7.) Configure resolv.conf
8.) Select a default tunnel
9.) Quit
?: ;此时建立一个新的PPTP Tunnel,选择5
Add a NEW PPTP Tunnel.
1.) Other
Which configuration would you like to use?:1 ;只有这一个,选1
Tunnel Name: test ;给连接起名字test
Server IP: 10.0.0.227 ;vpn服务器的ip
What route(s) would you like to add when the tunnel comes up?
This is usually a route to your internal network behind the PPTP server.
You can use TUNNEL_DEV and DEF_GW as in /etc/pptp.d/ config file
TUNNEL_DEV is replaced by the device of the tunnel interface.
DEF_GW is replaced by the existing default gateway.
The syntax to use is the same as the route(8) command.
Enter a blank line to stop.
route: TUNNEL_DEV ;用提示的输入
route: ;一个就够了,回车结束
Local Name and Remote Name should match a configured CHAP secret.
Local Name is probably your NT domain\username.
NOTE: Any backslashes (\) must be doubled (\\).
Local Name: pptp
Remote Name [PPTP]:
Adding test - 10.0.0.227 - pptp - PPTP
Added tunnel test
1.) List CHAP secrets
2.) Add a New CHAP secret
3.) Delete a CHAP secret
4.) List PPTP Tunnels
5.) Add a NEW PPTP Tunnel
6.) Delete a PPTP Tunnel
7.) Configure resolv.conf
8.) Select a default tunnel
9.) Quit
?:9
退出后再进入程序
./pptp-command
1.) start
2.) stop
3.) setup
4.) quit
What task would you like to do?: 1 ;选1,开始
1.) test
Start a tunnel to which server?: test ;在选择要连接的名称
注意:pptp-command这个脚本有个bug,开始连接后不能正常结束程序,并且在连接建立后给出个错误的路由,
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.227 * 255.255.255.255 UH 0 0 0 ppp0
10.0.0.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
解决方法为
先删除错误那个错误的路由
route del 10.0.0.227
然后
route add -net 10.3.3.0/24 dev ppp0
===========================
请弟兄们发帖时要写个好标题,多谢!
===========================
每天以1000KM/H的速度在跑,感觉还是时间不够:(
“西学东渐,洋为中用” + 创造 = ?
linux ppc
由 tiger2008 在 08-31-2002 09:35 发表:
我按以下做的﹐但提示錯誤﹗﹗
我按以下方法在我的服務器上做了一下﹐可以在運行/usr/sbin/pptpd時出現錯誤;另外我不知上面所講是否是作一台vpn server﹐在外部client(98,2000)可以透過internet通過它連入與這台server相連的網路。
中小企业Reahat 7.2 + PoPtoP 实现VPN一例
摘要
中小企业Reahat 7.2 + PoPtoP 实现VPN一例(2002-07-01 14:27:12)
--------------------------------------------------------------------------------
By susu
作者:苏仕明 2002.06.10
声明:1.第一次写此类文章,写得不好,先自我解嘲:见笑了。
2.如本文确实对你有用,请EMAIL:[email protected],不妨鼓励几句以示你的谢意。
3.如转载本文,请保持本文的完整,包括声明。
4.保留其他一切权利。
什么是VPN?大家千万别问我,我只是略懂那么一丁点皮毛而已,不过大家可以阅读后面提到的参考文章。我只知道我为什么要用到VPN,呵呵,相信有很多象我一样的莱鸟。
我使用VPN的原由是最近我用DELPHI写了一个 ActiveForm 放在我们的内部WEB服务器上,以便公司总部外的分部可以通过IE访问数据和打印一些奇怪的报表,该ActiveForm 需要访问内部网上的另一台机器。顺便介绍一下我们公司的网络配置情况:公司总部有一局域网,大家通过一台专用的LINUX服务器拨ADSL(包月200元的那一种)共享上网,该LINUX服务器也运行WWW、EMAIL、DNS、DHCP等服务,当然也运行IPCHAINS。公司对外网站租用虚拟主机(带域名系统)。
我们的做法是,公司分部先上互连网,然后拨通VPN,使其可以以内部IP身份访问内部网。那样,我的ActiveForm 就可以发挥作用了。
下面内容一、二、三是我们实现VPN应用的相关步骤,四是给大家一些参考文章。
一、服务器安装
1.取得PoPToP软件,可到 http://www.poptop.org下载,现在是1.2版。
2.安装:
rpm -ivh pptpd-1.0.0-1.i386.rpm
3.编辑文件/etc/syslog.conf,增加一行:
daemon.debug /var/log/pptpd.log<br