1.获取3.2.9 kernel

http://www.kernel.org/

 

2.linux-3.2.9内核包到/usr/src目录

cd /usr/src
tar -xzvf linux-3.2.9.tar.bz2  -C /usr/src
cd linux-3.2.9
make mrproper 清除环境变量,即清除配置文件(这边可能会出现时钟问题,调整系统时间就好了)
make menuconfig 在菜单模式下选择需要编译的内核模块:

networking support—>networking options—>network packet filtering framework(netfilter)

(1).core netfilter configuration

A 勾中”Netfilter connection tracking support” -m state相关模块是依赖它的,不选则没有。

B 将netbios name service protocal support(new) 编译成模块,不然后面升级iptables后启动时会出错

C 勾中“Netfilter Xtables support (required for ip_tables)”

(2).IP: Netfilter Configuration

A 将 “IPv4 connection tracking support (require for NAT)” 编译成模块。

B 勾中IP tables support (required for filtering/masq/NAT) 。

C 将 “Full NAT” 下的 “MASQUERADE target support” 和 “REDIRECT target support” 编译成模块

(3).其它模块可以根据自己的需要进行选择,若不懂可以参考内核配置手册.

make clean 确保所有东西均保持最新状态.

make bzImage 生成内核文件

make modules 编译模块

make modules_install 安装模块

make install 安装

mkinitrd  /boot/initramfs-3.2.9.img    根据内核版本和指定参数生成映像文件

cp arch/x86/boot/bzImage /boot/vmlinuz-3.2.9

cp /usr/src/linux-3.2.9/System.map /boot/System.map-3.2.9

3.在/etc/grub.conf添加如下2.6.30的信息,并把default=1改为default=0

4.重启成功后,再看看内核,是2.6.30,ok了。