1 安裝環境
Linux FC4(Kernel 2.6.13)
pptpd-1.3.0-0
pptp-1.7.0-2.fc4
ppp-2.4.3-5.fc4
2 安裝步驟
2.1 升級及編譯核心
2.1.1 下載核心
到http://www.kernel.org/pub/linux/kernel/v2.6下載新的核心
※也可以下載與現在核心相同的版本
以本文測試環境為例
[root@dns tmp] # wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.13.tar.bz2
2.1.2 下載MPPE與MPPC核心修正檔
到http://mppe-mppc.alphacron.de/下載對應先前核心版本的MPPE-MPPC修補程式
[root@dns tmp] # wget http://mppe-mppc.alphacron.de/linux-2.6.13-mppe-mppc-1.3.patch.gz
2.1.3 開始編譯核心
[root@dns tmp] # tar jxvf linux-2.6.13.tar.bz2
[root@dns tmp] # cd linux-2.6.13
[root@dns linux-2.6.13] # gzip –cd ../linux-2.6.13-mppe-mppc-1.3.patch.gz | patch –p1
patching file drivers/net/Kconfig
patching file drivers/net/Makefile
patching file drivers/net/ppp_generic.c
patching file drivers/net/ppp_mppe_mppc.c
patching file include/linux/ppp-comp.h
[root@dns linux-2.6.13] # cp /boot/config-2.6.11-1.1369_FC4 .config
[root@dns linux-2.6.13] # make menuconfig
進入選單後,選擇Device Drivers/Networking support
勾選PPP BSD-Compress compression及Microsoft PPP compression/encryption MPPC/MPPE)
儲存後離開
[root@dns linux-2.6.13] # make all
[root@dns linux-2.6.13] # make module_install
[root@dns linux-2.6.13] # depmod –a
[root@dns linux-2.6.13] # mkinitrd /boot/initrd-2.6.13.img 2.6.13 ←視實際版本修改
※ vi /usr/src/linux-2.6.13/Makefile
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 13
EXTRAVERSION =
……
[root@dns linux-2.6.13] # cp System.map /boot/System.map-2.6.13 ←視實際版本修改
[root@dns linux-2.6.13] # cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.13
2.1.4 修改GRUB
[root@dns linux-2.6.13] # vi /boot/grub/menu.lst
……
default = 0
timeout = 5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.13)
root (hd0,0)
kernel /vmlinuz-2.6.13 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.13.img
2.1.5 於開機時載入所需的核心模組
[root@dns linux-2.6.13] # vi /etc/rc.d/rc.local
……
modprobe ppp_mppe_mppc
2.1.6 檢查是否正確
[root@dns linux-2.6.13] # uname –a
Linux dns.yungchuang.com.tw 2.6.13 #1 Sat Oct 22 2005 i686 i686 i386 GNU/Linux
2.1.7 檢查核心是否有載入相關模組
[root@dns linux-2.6.13] # lsmod | grep ppp
ppp_async 13568 0
crc_ccitt 2432 1 ppp_async
ppp_mppe_mppc 16644 0
ppp_generic 42388 2 ppp_async,ppp_mppe_mppc
slhc 7552 1 ppp_generic
2.1.8 下載PPTP套件
[root@dns linux-2.6.13] # yum install pptp
[root@dns linux-2.6.13] # rpm –qa | grep pptp
pptpconfig-20040722-6
pptpd-1.3.0-0
pptp-1.7.0-2.fc4
2.1.9 編輯 /etc/pptpd.conf
……
option /etc/ppp/options.pptpd ← 與後面的 /etc/ppp.options.pptpd檔相同
localip 192.168.0.254 ← 區域網路中PPTP伺服器的IP
remoteip 192.168.0.238-245 ← 分配給PPTP使用者的IP
2.1.10 編輯 /etc/ppp/options.pptpd
……
name pptpd ← Server name for authentication
require-mschap-v2 ← MS-CHAP version 2 authentication
require-mppe-128 ← Use 128-bit MPPE encryption?
require-mppe ← Enable MPPE encryption?
require-mppe-40 ← Use 40-bit MPPE encryption?
require-mschap ← MS-CHAP authentication
ms-dns 168.95.1.1 ← Local User DNS Server
ms-dns 168.95.192.1 ← Local User DNS Server
proxyarp ← Create proxy ARP entry?
(讓本地網路知道遠端 client 的連線在這台 server 上)
lock ← Lock PTY device file?
nobsdcomp ← Disable BSD-Compress compression
novj ← Disable Van Jacobson compression
mtu 1450 ← Maximum sending packet size(bytes)
mru 1450 ← Maximum receiving packet size(bytes)
ipcp-accept-local ← 選定該選項, pppd 將接受撥入方提供的ip地址
ipcp-accept-remote ← 選定該選項, pppd 將接受撥入方自己的ip地址
lcp-echo-failure 3 ←
lcp-echo-interval 5 ←
deflate 0 ←
+chap ← CHAP authentication
+mschap-v2 ← MS-CHAP version 2 authentication
auth ← Require authentication
2.1.11 編輯 /etc/ppp/options.pptpd
# client(使用者名稱) server(伺服器名稱) secret(密碼) IP addresses(來源IP)
chance pptpd xxxx *
jennifer pptpd xxxx *