红联Linux门户
Linux帮助

RH Linux 9下面的VPN Server架设指南

发布时间:2006-10-30 01:03:30来源:红联作者:tongxiaokun
  Server: Red Hat Linux 9 Kernel 2.6.10

  Client: Win2000 Pro/Server SP4,WinXP SP2

  Server所需要:

  www.kernel.org
  kernel: linux-2.6.10.tar.bz2

  http://www.polbox.com/h/hs001/
  kernel_patch: linux-2.6.10-mppe-mppc-1.2.patch.gz
  pppd: ppp-2.4.3.tar.gz
  pppd_patch: ppp-2.4.3-mppe-mppc-1.1.patch.gz
  pptpd: pptpd-1.2.3.tar.gz

  为了方便起见,可以把它们放在同一个目录下

  我不喜欢用RPM方式安装,所以都是用的源码方式编译安装
一、先给内核打补丁

# tar zjvf linux-2.6.10.tar.bz2
# gunzip linux-2.6.10-mppe-mppc-1.2.patch.gz
# patch -p0 -i linux-2.6.10-mppe-mppc-1.2.patch
# ln -s linux-2.6.10 linux
# cd linux
# make menuconfig
Device Drivers -> Networking Support->


  把 "PPP support" 编进内核,你也可作为模块编译。

PPP Support for async serial ports
PPP Support for sync tty ports
PPP Deflate compression
Microsoft PPP compression/encryption (MPPC/MPPE)"
Cryptographic options


  把 "Cryptographic API" 编进内核,你也可作为模块编译。确保SHA1 和 ARC4 支持已经选上:

SHA1 digest algorithm
ARC4 cipher algorithm


  保存配置文件,退出

  编译内核

  make all modules modules_install install

  修改/etc/modprobe.conf (2.4的Kernel请修改/etc/modules.conf)

  重启,进入2.6.10

二、安装PPP

  安装之前先用 rpm -qa |grep ppp 看一下是否系统有安装RH9自带的ppp-2.4.1-10

  如果有的话, 用 rpm -e 卸载先,可能还有依赖关系,依次卸载,如:

#rpm -e rp-pppoe-3.5-2
#rpm -e wvdial-1.53-9
#rpm -e ppp-2.4.1-10

# tar xzvf ppp-2.4.3.tar.gz
# gunzip ppp-2.4.3-mppe-mppc-1.1.patch
# patch -p0 -i ppp-2.4.3-mppe-mppc-1.1.patch
# cd ppp-2.4.3
# ./configure
# make; make install


  三、安装 pptpd


#tar xzvf pptpd-1.2.3.tar.gz
# ./configure
# make; make install


  相关的配置文件:

/etc/pptpd.conf
# pptpd的基本配置文件
/etc/ppp/options.pptpd
# VPN拨号选项
/etc/ppp/chap-secrets
# 用户名和密码信息
/etc/modules.conf
# 模块加载信息
(2.4的Kernel请修改/etc/modules.conf)

vi /etc/pptpd.confppp /usr/local/sbin/pppd
#指定pppd的路径
option /etc/ppp/options.pptpd
# 指定option 文件位置
localip 192.168.1.3
#同服务器的LAN地址
remoteip 192.168.1.230-239
#分配?客户端的ip


  本例范围从192.168.1.230到192.168.1.239。您也可以单独指定某个地址或者多段地址,用逗号隔开,如在192.168.1.230-239,192.168.1.254

vi /etc/ppp/options.pptpd

name *
lock
mtu 1450
mru 1450
proxyarp
auth
ipcp-accept-local
ipcp-accept-remote
lcp-echo-failure 3
lcp-echo-interval 5
deflate 0
# Handshake Auth Method
- 加密协议类型
+chap
+mschap-v2
# Data Encryption Methods
mppe required,stateless
其它详细说明请参见 man pppd
或者 man pptpd

vi /etc/ppp/chap-secrets
#client server Password IP Address
test * 12345 *


因为密码是明文显示的,最好能修改文件权限,使root作为owner和chmod 700

vi /etc/modules.conf
alias char-major-108 ppp_generic
alias /dev/ppp ppp_generic
alias tty-ldisc-3 ppp_async
alias tty-ldisc-14 ppp_synctty
alias ppp-compress-18 ppp_mppe_mppc
alias ppp-compress-21 bsd_comp
alias ppp-compress-24 ppp_deflate
alias ppp-compress-26 ppp_deflate


  重新启动

# reboot


  在我这里 alias ppp-compress-18 ppp_mppe_mppc 好像没用,只好手动加载:

# modprobe ppp_mppe_mppc


  确认内核支持

strings `which pppd`|grep -i mppe|wc --lines
30
###大于等于30就行#####
[strings `which pppd`|grep -i mppc|wc --lines
7
#### 不为 0 #####
dmesg | grep MPPE
MPPE/MPPC encryption/compression module registered


  启动pptpd

# /usr/local/sbin/pptpd
Mar 17 23:07:32 localhost pptpd[4471]:
MGR: Manager process started
Mar 17 23:07:32 localhost pptpd[4471]:
MGR: Maximum of 10 connections available


  设置客户端连接,“安全”里面选择自定义,如图所示,这里取决于你在option.pptpd里面的设置:

Mar 17 23:09:59 localhost pptpd[4473]:
CTRL: Client 192.168.1.136
control connection started
Mar 17 23:09:59 localhost pptpd[4473]:
CTRL: Starting call
(launching pppd, opening GRE)
Mar 17 23:09:59 localhost pppd[4474]:
pppd 2.4.3 started by root, uid 0
Mar 17 23:09:59 localhost pppd[4474]:
Using interface ppp0
Mar 17 23:09:59 localhost pppd[4474]:
Connect: ppp0 <--> /dev/pts/1
Mar 17 23:10:02 localhost pptpd[4473]:
CTRL: Ignored a SET LINK INFO
packet with real ACCMs!
Mar 17 23:10:02 localhost pppd[4474]:
MPPC/MPPE 128-bit stateless compression enabled
Mar 17 23:10:04 localhost pppd[4474]:
found interface eth0 for proxy arp
Mar 17 23:10:04 localhost pppd[4474]:
local IP address 192.168.1.3
Mar 17 23:10:04 localhost pppd[4474]:
remote IP address 192.168.1.230

  成功!
文章评论

共有 2123 条评论

  1. 0.0.0.* 于 2007-03-07 22:52:50发表:

    free casino game free casino game http://freecasinogamelwig.blogspot.com http://lasvegascasinotaem.blogspot.com las vegas casino las vegas casino http://onlinecasinogamegauy.blogspot.com online casino game online casino game http://playcrapsonlinefreeshw.blogspot.com play craps online free play craps online free top online casino top online casino http://toponlinecasinolbw.blogspot.com jack black jack black http://jackblackrpumu.blogspot.com casino on net http://casinoonnetgpp.blogspot.com casino on net http://howtoplaycrapsiieuno.blogspot.com how to play craps how to play craps blackjack game blackjack game http://blackjackgamedgkhup.blogspot.com casino game casino game http://casinogameahwwv.blogspot.com

  2. 0.0.0.* 于 2007-03-07 22:07:22发表:

    roulette roulette http://roulettehncgcm.blogspot.com http://onlinecasinogamblingbytvmw.blogspot.com online casino gambling online casino gambling http://casinopokerylve.blogspot.com casino poker casino poker slots game slots game http://slotsgamecyprw.blogspot.com keno casino keno casino http://kenocasinopete.blogspot.com play keno online play keno online http://playkenoonlineayup.blogspot.com best online casino gambling best online casino gambling http://bestonlinecasinogamblinghkyncy.blogspot.com keno http://kenosuelm.blogspot.com keno free casinos http://freecasinosnayuiu.blogspot.com free casinos casino guide casino guide http://casinoguidecvm.blogspot.com

  3. 0.0.0.* 于 2007-03-07 21:57:29发表:

    backgammon http://backgammonppgish.blogspot.com backgammon http://casinofufii.blogspot.com casino casino free video poker free video poker http://freevideopokermopwel.blogspot.com online casino http://onlinecasinouiufk.blogspot.com online casino http://casinogamebsfurt.blogspot.com casino game casino game craps online craps online http://crapsonlinesrgwok.blogspot.com roulette roulette http://roulettebweb.blogspot.com http://bestonlinecasinomtbd.blogspot.com best online casino best online casino http://casinoumw.blogspot.com casino casino http://freeslotsmachinehfu.blogspot.com free slots machine free slots machine

  4. 221.212.177.* 于 2007-03-07 20:44:59发表:

    http://slotsgamebacyg.blogspot.com slots game slots game http://onlinecasinogamebkktpr.blogspot.com online casino game online casino game vegas casino vegas casino http://vegascasinokboynh.blogspot.com free casino free casino http://freecasinoont.blogspot.com http://casinogametcuhe.blogspot.com casino game casino game http://internetkenorkm.blogspot.com internet keno internet keno http://freeonlinekenorcd.blogspot.com free online keno free online keno online casino gambling http://onlinecasinogamblingahmg.blogspot.com online casino gambling http://onlinecasinosassfe.blogspot.com online casinos online casinos virtual casino virtual casino http://virtualcasinototi.blogspot.com

  5. 89.108.83.* 于 2007-03-07 20:38:25发表:

    free casino game free casino game http://freecasinogamevdl.blogspot.com play craps online free play craps online free http://playcrapsonlinefreetherb.blogspot.com roulette http://rouletteadgdc.blogspot.com roulette http://freecasinogameobd.blogspot.com free casino game free casino game http://gamblingcasinoonlinetig.blogspot.com gambling casino online gambling casino online http://playbingoonlinedli.blogspot.com play bingo online play bingo online blackjack blackjack http://blackjackshccf.blogspot.com http://kenoaablii.blogspot.com keno keno best online casino gambling best online casino gambling http://bestonlinecasinogamblingfswi.blogspot.com online craps http://onlinecrapsvkysc.blogspot.com online craps

  6. 0.0.0.* 于 2007-03-07 20:33:04发表:

    play blackjack play blackjack http://playblackjackrfh.blogspot.com best online casino http://bestonlinecasinodwr.blogspot.com best online casino online casino online casino http://onlinecasinolumte.blogspot.com http://freebingodffkm.blogspot.com free bingo free bingo play blackjack http://playblackjackdtupr.blogspot.com play blackjack online casinos http://onlinecasinosdbvn.blogspot.com online casinos play keno online play keno online http://playkenoonlineyik.blogspot.com online blackjack online blackjack http://onlineblackjackwlhea.blogspot.com roulette roulette http://rouletteghbt.blogspot.com http://playblackjacksslcgg.blogspot.com play blackjack play blackjack

  7. 201.83.117.* 于 2007-03-07 20:29:47发表:

    best online casino gambling http://bestonlinecasinogamblinguwrla.blogspot.com best online casino gambling bingo bingo http://bingocthsvm.blogspot.com how to play craps how to play craps http://howtoplaycrapsmciv.blogspot.com craps rules http://crapsruleskpcwyb.blogspot.com craps rules baccarat online baccarat online http://baccaratonlinefcakn.blogspot.com keno keno http://kenofol.blogspot.com free bingo http://freebingorhslbv.blogspot.com free bingo http://casinogaminglev.blogspot.com casino gaming casino gaming rules of craps rules of craps http://rulesofcrapshlswcg.blogspot.com http://baccaratgba.blogspot.com baccarat baccarat

  8. 65.73.204.* 于 2007-03-07 20:29:44发表:

    play craps http://playcrapsgcseg.blogspot.com play craps rules of craps http://rulesofcrapsdawhd.blogspot.com rules of craps free keno games free keno games http://freekenogamesifyu.blogspot.com free casinos http://freecasinosgflu.blogspot.com free casinos free bingo free bingo http://freebingokrmcr.blogspot.com online casino game online casino game http://onlinecasinogameega.blogspot.com http://slotsgamevwbi.blogspot.com slots game slots game http://onlinecasinogamebmuuof.blogspot.com online casino game online casino game play craps online free play craps online free http://playcrapsonlinefreetldf.blogspot.com online roulette online roulette http://onlineroulettecrpen.blogspot.com

  9. 0.0.0.* 于 2007-03-07 17:53:15发表:

    Thank you for creating this wonderful place on the web. casinos gratuits bonus gratuits casinos casino de paris jeu de cartes casino net casino ligne internet casino casino virtuel top casinos en ligne

  10. 0.0.0.* 于 2007-03-07 17:44:50发表:

    We read about your website everywhere and think that it's a wonderful idea. jeu en ligne jeu casino gratuit internet casino gamme com jeu casino en line casino gratuit bonus des casinos en ligne jeu online baccarat salles de jeux

  11. 0.0.0.* 于 2007-03-07 17:31:53发表:

    We read about your website everywhere and think that it's a wonderful idea. casinos gratuits casinos casino en ligne jeu gratuit casinos en ligne bonus casinos gratuits meilleures promotions en ligne banque casino le top des casinos en ligne

  12. 0.0.0.* 于 2007-03-07 12:00:19发表:

    The site is easy to use and very helpful. Thank you for this wonderful service. I am recommending it to everyone. station hotel and casino 1 32 scale slots car bonus casino code nd online rtg gaming club casino free money no purchase casino hard rock casino wheel of fortune strip russian roulette play slots machine on the internet 100 best online casino bingo

  13. 0.0.0.* 于 2007-03-07 11:57:45发表:

    The site is easy to use and very helpful. Thank you for this wonderful service. I am recommending it to everyone. station hotel and casino 1 32 scale slots car bonus casino code nd online rtg gaming club casino free money no purchase casino hard rock casino wheel of fortune strip russian roulette play slots machine on the internet 100 best online casino bingo