生产环境:CentOS 5.5 32bit
现有内核:2.6.18
实现目标:升级到2.6.28并支持XFS JFS reiser4 ext4 layer7
1、准备:
cd /usr/src
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
#内核包
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.28.tar.gz
#layer7
wget http://downloads.sourceforge.net/project/l7-filter/l7-filter%20kernel%20version/2.22/netfilter-layer7-v2.22.tar.gz?use_mirror=nwget
#L7协议文件
wget http://sourceforge.net/projects/l7-filter/files/Protocol%20definitions/2009-05-28/l7-protocols-2009-05-28.tar.gz/downloadcu
#iptables
wget http://www.netfilter.org/projects/iptables/files/iptables-1.4.6.tar.bz2
2、开始安装:
rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
解压源码包
tar xzf linux-2.6.28.tar.gz
tar xjf iptables-1.4.6.tar.bz2
tar xzf l7-protocols-2009-05-28.tar.gz
tar xzf netfilter-layer7-v2.22.tar.gz
cd linux-2.6.28
make mrproper #清理工作
patch -p1 < /usr/src/netfilter-layer7-v2.22/kernel-2.6.25-2.6.28-layer7-2.22.patch #打上L7补丁
cp /boot/config-2.6.18-128.el5PAE ./.config
make menuconfig
在filesystem中把xfs选上,我是编译进内核的(即前面那个变成*号 ,M是模块)
在Networking–Networking options–Network packet filtering (replaces ipchains)–Core Netfilter Configuration,把L7支持 string 等选上
make
make bzImage
make modules
make modules_install
make install
3、重启系统
#uname -a
Linux localhost.localdomain 2.6.28 #2 SMP Tues Dec 15 20:29:50 CST 2011 i686 i686 i386 GNU/Linux
4、编译iptables 支持layer7
cd /usr/src/netfilter-layer7-v2.22/iptables-1.4.3forward-for-kernel-2.6.20forward/
cp libxt_layer7.* /usr/src/iptables-1.4.6/extensions/
cd /usr/src/iptables-1.4.6/
./configure –prefix=/ –with-ksource=/usr/src/linux-2.6.28
make
make install
#iptables -V
iptables v1.4.6
安装协议
cd /usr/src
cd l7-protocols-2009-05-28
make install
#iptables -t mangle -I PREROUTING -m layer7 –l7proto edonkey -j DROP
如没有提示 则无问题
安装文件系统工具
yum install xfsprogs dmapi xfsdump
安装 xfs文件系统工具
wget http://ftp.ntu.edu.tw/linux/utils/fs/reiser4/libaal/libaal-1.0.5.tar.bz2
wget http://ftp.ntu.edu.tw/linux/utils/fs/reiser4/reiser4progs/reiser4progs-1.0.7.tar.gz
安装步骤基本是make ;make install
在安装libaal时候遇到 configure: error: C++ preprocessor “/lib/cpp” fails sanity check
使用yum install gcc-c++解决
接下来可以体验下L7和XFS等文件系统了。