Jun 13

[原]解决PPTP中Module ppp_mppe not found的问题 阴

linuxing , 12:56 , 网络服务 » 远程管理 , 评论(0) , 引用(0) , 阅读(24045) , Via 本站原创 | |
    正如前面提到的,pptpsetup脚本在运行时会检查核心是否支持MPPE模块,以及PPP是否支持MPPE加密。若不满足条件,会报类似:
引用
FATAL: Module ppp_mppe not found.
/usr/sbin/pptpsetup: couldn't find MPPE support in kernel.

/usr/sbin/pptpsetup: couldn't find MPPE support in pppd.

PPP的问题容易解决,升级版本即可。核心的问题,有些麻烦,有两种办法,一是重编核心,二是采用dkms 外挂。

这里以红旗DC Server 5.0 SP4为例,其自带PPP版本已提供MPPE支持。但核心不支持。

一、重编核心
重编核心的方法这里不细说,找个build看看,在configure中选上下面的选项:
引用
CONFIG_PPP_MPPE=m

CONFIG_NF_CONNTRACK_PPTP=m
CONFIG_NF_NAT_PPTP=m

CONFIG_PPP=m
CONFIG_PPP_MULTILINK=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
CONFIG_PPP_MPPE=m
CONFIG_PPPOE=m
CONFIG_PPPOL2TP=m

按常规的核心步骤编译,重启即可。

二、采用dkms 外挂
dkms 是个好东西,很多驱动也采用这种外挂方式(特别是Dell 提供的驱动)。从poptop官网下载mppe module builder目录中的文件:
引用
dkms-2.0.6-1.noarch.rpm
kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm

本地下载(含src.rpm):
安装:
引用
# rpm -ivh dkms-2.0.6-1.noarch.rpm kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
准备...                     ########################################### [100%]
   1:dkms                   ########################################### [ 50%]
   2:kernel_ppp_mppe        ########################################### [100%]

Creating symlink /var/lib/dkms/kernel_ppp_mppe/1.0.2/source ->
                 /usr/src/kernel_ppp_mppe-1.0.2

DKMS: add Completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Running the pre_build script:
Using /usr/src/linux-2.6.9-89.5AXS2/drivers/net/ppp_generic.c

Building module:
applying patch linux-2.6.2-pad.patch...patching file ppp_generic.c
Hunk #1 succeeded at 1094 (offset 49 lines).
Hunk #3 succeeded at 1640 (offset 50 lines).

applying patch 02-ppp_generic.c.patch...patching file ppp_generic.c

applying patch 03-ppp_mppe_compress.c.patch...patching file ppp_mppe_compress.c

applying patch 04-ppp_mppe_compress.c_license.patch...patching file ppp_mppe_compress.c
Hunk #1 succeeded at 654 (offset 1 line).

cleaning build area... .
make KERNELRELEASE=2.6.9-89.5AXS2smp -C /lib/modules/2.6.9-89.5AXS2smp/build M=/var/lib/dk                                                                              ms/kernel_ppp_mppe/1.0.2/build....

Running the post_build script:
cleaning build area....

DKMS: build Completed.
Running module version sanity check.

ppp_generic.ko:
- Original module
   - Found /lib/modules/2.6.9-89.5AXS2smp/kernel/drivers/net/ppp_generic.ko
   - Storing in /var/lib/dkms/kernel_ppp_mppe/original_module/2.6.9-89.5AXS2smp/i686/
   - Archiving for uninstallation purposes
- Installation
   - Installing to /lib/modules/2.6.9-89.5AXS2smp/kernel/drivers/net/

ppp_mppe.ko:
- Original module
- Installation
   - Installing to /lib/modules/2.6.9-89.5AXS2smp/kernel/drivers/net/

depmod....

DKMS: install Completed.

可尝试手动加载ppp-compress-18模块试试:
引用
# modprobe ppp-compress-18 && echo 'mppe support'
mppe support

这输出是正确的,可再次运行pptpsetup,后续步骤与之前都是一样的。

※注意
若输出为下面的信息则是错误的:
引用
WARNING: Error inserting ppp_generic (/lib/modules/2.6.9-89.5AXS2smp/kernel/drivers/net/ppp_generic.ko): Invalid module format
FATAL: Error inserting ppp_mppe (/lib/modules/2.6.9-89.5AXS2smp/kernel/drivers/net/ppp_mppe.ko): Invalid module format

原因可能是因为编译核心模块所使用的gcc版本问题。DC Server 5.0(Asianux 2.0)默认gcc版本为3.4.6,核心模块也采用3.4的gcc进行编译的(从备份的核心模块可得知):
引用
# /usr/bin/gcc346 -v
Reading specs from /usr/lib/gcc/i386-asianux-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-asianux-linux
Thread model: posix
gcc version 3.4.6 20060404 (Asianux 2.0 3.4.6-11.1)
# modinfo /var/lib/dkms/kernel_ppp_mppe/original_module/2.6.9-89.5AXS2smp/i686/ppp_generic.ko
filename:       /var/lib/dkms/kernel_ppp_mppe/original_module/2.6.9-89.5AXS2smp/i686/ppp_generic.ko
license:        GPL
alias:          char-major-108-*
alias:          /dev/ppp
vermagic:       2.6.9-89.5AXS2smp SMP 686 REGPARM 4KSTACKS gcc-3.4
depends:        slhc

但如果由于某些原因,例如:安装Oracle 9i 时,通过oracle9i_support-2.0-4AX.i386.rpm 提供的chgcc.sh脚本更改了gcc版本。那么,就会有问题了:
引用
# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --enable-languages=c,c++ --disable-libgcj --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Asianux 1.0 3.2.3-47.3)
[root@localhost ~]# modinfo ppp_generic
filename:       /lib/modules/2.6.9-89.5AXS2smp/kernel/drivers/net/ppp_generic.ko
license:        GPL
alias:          char-major-108-*
alias:          /dev/ppp
vermagic:       2.6.9-89.5AXS2smp SMP 686 REGPARM 4KSTACKS gcc-3.2
depends:        slhc

解决办法是,卸载dkms和kernel_ppp_mppe包,恢复gcc版本后重新编译安装:
引用
# rpm -e dkms kernel_ppp_mppe
# chgcc.sh -v 346
The current gcc version is 2.96.
The current g++ version is 2.96.

The gcc and g++ were changed to each 3.4.6(original version).
When you want to change 2.96, run "/usr/sbin/chgcc.sh -v 296" command.

rm /usr/bin/gcc
rm /usr/bin/g++
mv /usr/bin/gcc346 /usr/bin/gcc
mv /usr/bin/g++346 /usr/bin/g++
# gcc -v
Reading specs from /usr/lib/gcc/i386-asianux-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-asianux-linux
Thread model: posix
gcc version 3.4.6 20060404 (Asianux 2.0 3.4.6-11.1)
# rpm -ivh dkms-2.0.6-1.noarch.rpm kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
# modinfo ppp_generic
filename:       /lib/modules/2.6.9-89.5AXS2smp/kernel/drivers/net/ppp_generic.ko
license:        GPL
alias:          char-major-108-*
alias:          /dev/ppp
vermagic:       2.6.9-89.5AXS2smp SMP 686 REGPARM 4KSTACKS gcc-3.4
depends:        slhc
# modinfo ppp_mppe
filename:       /lib/modules/2.6.9-89.5AXS2smp/kernel/drivers/net/ppp_mppe.ko
license:        Dual BSD/GPL
vermagic:       2.6.9-89.5AXS2smp SMP 686 REGPARM 4KSTACKS gcc-3.4
depends:        ppp_generic
# modprobe ppp-compress-18
# lsmod|grep ppp
ppp_mppe               17920  0
ppp_generic            33044  1 ppp_mppe
slhc                   11008  1 ppp_generic

问题解决。

三、其他
红旗DC Server 5.0 SP4与Asianux 3.0 SP3在配置时有些地方需要注意的。
1.用户名和密码不能有点号
我之前示例时,采用linuxfly.org作为用户名,在Asianux 3.0下没问题。但DC 5.0下总是报错:
引用
MS-CHAP authentication failed: Access denied

究其原因,把服务端和客户端的验证用户名改为linuxfly 就没问题了。

2.路由表处理方式不同
连接VPN:
引用
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.228.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.228.153 0.0.0.0         UG    0      0        0 eth0
# pon vpn
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.1     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
124.248.205.115 192.168.228.153 255.255.255.255 UGH   0      0        0 eth0
192.168.228.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.228.153 0.0.0.0         UG    0      0        0 eth0

可见,Asianux 3.0上需要手动添加的路由表,整理自行加上了(没深究原因)。所以,若要让流量都全部走VPN,则简单了:
引用
# route add -net 0.0.0.0 dev ppp0
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.1     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
124.248.205.115 192.168.228.153 255.255.255.255 UGH   0      0        0 eth0
192.168.228.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
0.0.0.0         192.168.228.153 0.0.0.0         UG    0      0        0 eth0
# tracepath www.163.com
1:  192.168.0.200 (192.168.0.200)                          0.142ms pmtu 1500
1:  192.168.0.1 (192.168.0.1)                             55.724ms

关闭VPN:
引用
# poff vpn
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
124.248.205.115 192.168.228.153 255.255.255.255 UGH   0      0        0 eth0
192.168.228.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.228.153 0.0.0.0         UG    0      0        0 eth0

关闭时,多余的路由自行删掉吧:
引用
# route del -host 124.248.205.115 dev eth0
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.228.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.228.153 0.0.0.0         UG    0      0        0 eth0
# tracepath www.163.com
1:  192.168.228.165 (192.168.228.165)                      0.119ms pmtu 1500
1:  192.168.228.153 (192.168.228.153)                      0.959ms
Tags:
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]