Article title: Kernel 2.6 does not compile the kernel to add modules to iptables. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. install the kernel source code.
[Root @ jiecho] # yum install kernel-source
2. download iptables-1.3.3.tar.bz2and patch-o-matic-ng-20050810.tar.bz2 and unpack them. for convenience, we put them under/usr/src,
-> IP: Select the following two M items in Netfilter Configuration.
TIME match support
IPP2P match support
Save and exit
5. Compile and install the module
The following is the most important step, because our principle is to save time, not re-compile the kernel, but only compile the modules,
The 2.4 kernel is different from the 2.6 kernel. I am depressed for a whole day. The 2.4 kernel module is in the form of *. o, and the 2.6 kernel is in the form of *. ko,
This has a way to change, refer to: http://blog.chinaunix.net/article.p...742&blogId=2662
Code:
[Root @ jiecho] # make modules
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/split-include
HOSTCC scripts/basic/docproc
HOSTCC scripts/conmakehash
HOSTCC scripts/kallsyms
CC scripts/empty. o
HOSTCC scripts/mk_elfconfig
MKELF scripts/elfconfig. h
HOSTCC scripts/file2alias. o
HOSTCC scripts/modpost. o
HOSTCC scripts/sumversion. o
HOSTLD scripts/modpost
HOSTCC scripts/pnmtologo
HOSTCC scripts/bin2c
At this point, ctrl + c can be aborted, because we do not need to compile all modules, which is a waste of time, rather than just the netfilter module,
However, if you directly execute make modules SUBDIRS = net/ipv4/netfilter, an error will occur, which is the difference between 2.4 and 2.6,
After a series of required files under the scripts directory, we can make modules SUBDIRS = net/ipv4/netfilter,
Use modpost and so on to generate *. o files into *. ko Files.
[Root @ jiecho] # make modules SUBDIRS = net/ipv4/netfilter
Copy the compiled module after compiling the netfilter module.
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.