[root@server ~]# yum install gcc*
[root@server ~]# yum list all |grep gcc*
This system is not registered with RHN.
RHN support will be disabled.
compat-libgcc-296.i386 2.96-138 installed
dejavu-lgc-fonts.noarch 2.10-1 installed
gcalctool.i386
gcc.i386
gcc-c++.i386
gcc-gfortran.i386
gcc-gnat.i386
gcc-java.i386
gcc-objc.i386
gcc-objc++.i386
gcc43.i386
gcc43-c++.i386
gcc43-gfortran.i386
gnome-python2-gconf.i386
java-
libgcc.i386
libgcj.i386
libgcj-devel.i386
libgcrypt.i386
libgcrypt-devel.i386
pkgconfig.i386 1:0.21-2.el5 installed
[root@server ~]# uname -r
--需要的内核包和补丁
[root@server ~]# ll
-rw-r--r-- 1 root root 435891 Apr 25 2010 iptables-
-rw-r--r-- 1 root root 128196 Oct 4 2008 l7-protocols-2008-10-04.tar.gz
-rw-r--r-- 1 root root 48622017 Oct 23 2008 linux-
-rw-r--r-- 1 root root 174790 Aug 23 2008 netfilter-layer7-v2.20.tar.gz
[root@server ~]#
[root@server ~]# tar jxvf linux-
[root@server ~]# tar zxvf netfilter-layer7-v2.20.tar.gz -C /usr/src/
[root@server ~]#
MA
[root@server linux-
[root@server linux-
/usr/src/linux-
[root@server linux-
配置新的内核:
[root@server linux-
在“Networking ---> Networking Options ---> Network Packet filtering framework (Netfilter) ”
1)---> Code Netfilter Configuration
//将“Netfilter connection tracking suport (NEW)”选择编译为模块(M),需选取此项才能看到layer7支持的配置。
//将layer7、string、state、time、IPsec、iprange、connlimit……等编译成模块,根据需要添加模块。
43-1
2)---> IP: Netfilter Configuration
//将“IPv4 connection tracking support (require for NAT)”编译成模块。
//将“Full NAT”下的“MASQUERADE target support”和“REDIRECT target support”编译成模块。
43-2
编译,安装模块,新内核
[root@server linux-
更改启动项,使用新内核启动
[root@server ~]# vim /etc/grub.conf
default=0
[root@server ~]#init 6
2.1卸载老的iptable
#mv /etc/init.d/iptables /etc/init.d/iptables.old
[root@server ~]# rpm -e iptables --nodeps
warning: /etc/sysconfig/iptables-config saved as /etc/sysconfig/iptables-config.rpmsave
[root@server ~]# rpm -qa |grep iptables
[root@server ~]#
--也可以用yum卸载
[root@server iptables-
2.2安装iptables+layer7补丁
[root@server~]# tar jxvf iptables-
[root@ser~]# cd /usr/src/netfilter-layer7-v2.20/iptables-
[root@server iptables-
[root@server iptables-
2.3编译安装
[root@server iptables-
[root@server iptables-
--执行 prefix安装目录 --with-ksource 指明调用源代码的文件
[root@server iptables-
[root@server iptables-
[root@server iptables-
2.4安装l7-protocols模式包
[root@server ~]# tar zxvf l7-protocols-
[root@server ~]# mv /etc/l7-protocols-
2.5 改写iptables的配置脚本
[root@server ~]# cp /etc/init.d/iptables.old /etc/init.d/iptables
[root@server ~]# service iptables start
Setting chains to policy ACCEPT: nat [ OK ]
Unloading iptables modules: [ OK ]
[root@server ~]#