Centos4.4 install the netfilter patch on the kernel

Source: Internet
Author: User
Centos4.4 upgrade the kernel and install the netfilter patch-Linux general technology-Linux programming and kernel information. For details, refer to the following section. 1. Download
Linux-2.6.15.6.tar.bz2
Patch-2.6.15.6.bz2
Iptables-1.3.6.tar.bz2
Patch-o-matic-ng-20061024.tar.bz2
2. Extract
Cd/usr/src
Tar-jxf linux-2.6.15.6.tar.bz2
Tar-jxf iptables-1.3.6.tar.bz2
Tar-jxf patch-o-matic-ng-20061024.tar.bz2

3. patch the kernel first
Cd/usr/src/linux-2.6.15.6
Bunzip2-dv/usr/src/patch-2.6.15.6.bz2 | patch-p0
Vi/usr/src/linux-2.6.15.6/include/linux/posix_types.h
# Define _ FD_SETSIZE 65536
Vi/usr/src/linux-2.6.15.6/include/linux/fs. h
# Define inr_open65536
# Define NR_FILE 65536
Vi/usr/src/linux-2.6.15.6/include/net/tcp. h
# Define TCP_TIMEWAIT_LEN (1 * HZ)
# Define TCP_SYNACK_RETRIES 3

4. Copy the original config
Cp/boot/config-2.6.9-42.ELsmp./. config
Note: I am a dual-CPU machine, so it is ELsmp
Make menuconfig

Select Load an Alternate Configuration File
Select. config
Save and exit

5. Patch netfilter
Cd/usr/src/path-o-matic-ng-20061024
./Runme -- download
Note: The above commands select to download patches such as ipp2p time.
Export KERNEL_DIR =/usr/src/linux-2.6.15.6
Export IPTABLES_DIR =/usr/src/iptables-1.3.6
./Runme ipp2p
./Runme time
./Runme connlimit

6. Configure kernel options
Networking
Networking options
Network packet filtering (replaces ipchains)
IP: Netfilter Configuration
Select ipp2p, time, and Connections/IP

Security options
Remove NSA SELinux Support options

Save and exit

Vi/etc/sysconfig/selinux
SELINUX = disabled

7. Start compilation and Installation
Make all
Make modules
Make modules_install
Make install

8. Set grub. conf
Set items with default = 0

Restart the computer

9. Install the new version of iptable
Cd/usr/src/iptables-1.3.6
Export KERNEL_DIR =/usr/src/linux-2.6.15.6
Export IPTABLES_DIR =/usr/src/iptables-1.3.6
Make BINDIR =/sbin LIBDIR =/lib MANDIR =/usr/share/man install

10. Test
Uname-r display kernel version
Iptables-V displays the iptables version
Ulimit-a: displays the maximum number of opened files and other parameters
Top 1 to check cpu support
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.