The current system is CentOS Linux release 6.0 (Final), and the kernel version is 2.6.32-71. el6.i686. due to the latest kernel Vulnerability (linux kernel has a memory elevation vulnerability, 2.6.39 kernel is not spared, So we upgraded the kernel to the latest version 3.2.2.
1. view the current system kernel
# uname -r2 2.6.32-71.el6.i686
2. Download The linux-3.2.2 kernel package
# cd ~# wget -c http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.2.tar.bz2# tar jxvf linux-3.2.2.tar.bz2# cd linux-3.2.2
3. Configure and install the kernel
# Make mrproper # Clear environment variables, that is, clear the configuration file # make menuconfig # select the kernel model to be compiled in menu Mode
Find the following selected options and select networking support → networking options → network packet filtering framework (netfilter)
(1). core netfilter configuration
- "Netfilter connection tracking support"-m state related modules depend on it. If this parameter is not selected, no.
- Compile netbios name service protocal support (new) into a module. Otherwise, an error will occur when iptables is upgraded later.
- Check "Netfilter Xtables support (required for ip_tables )"
(2). IP: Netfilter Configuration
- Compile "IPv4 connection tracking support (require for NAT)" into a module.
- Check the IP tables support (required for filtering/masq/NAT ).
- Compile "MASQUERADE target support" and "REDIRECT target support" under "Full NAT" into a module
(3) other modules can be selected based on their own needs. If not, refer to the Kernel configuration manual.
# Make clean # make sure everything is up-to-date. # make bzImage # generate the Kernel File # make modules # compilation Module # make modules_install # installation Module # make install # Installation
4. Edit the/etc/grub. conf file and change default = 1 to default = 0.
# cat /etc/grub.conf# grub.conf generated by anaconda## Note that you do not have to rerun grub after making changes to this file# NOTICE: You have a /boot partition. This means that# all kernel and initrd paths are relative to /boot/, eg.# root (hd0,0)# kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root# initrd /initrd-[generic-]version.img#boot=/dev/sdadefault=1timeout=5splashimage=(hd0,0)/grub/splash.xpm.gzhiddenmenutitle CentOS Linux (3.2.2)root (hd0,0)kernel /vmlinuz-3.2.2 ro root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quietinitrd /initramfs-3.2.2.imgtitle centos (2.6.32-71.el6.i686)root (hd0,0)kernel /vmlinuz-2.6.32-71.el6.i686 ro root=/dev/mapper/VolGroup-lv_root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quietinitrd /initramfs-2.6.32-71.el6.i686.img
5. restart the system and view the kernel
# reboot # uname -r3.2.2
Reprinted address:
Http://www.linuxde.net/2012/02/7257.html
Http://xugang.blog.51cto.com/400032/95621/