Iptables prompts unabletoinitializetable 'filter' solution

Source: Internet
Author: User
Partially execute yumupdate to upgrade or compile the Linux kernel. after the upgrade is completed, restart or start iptables. & ldquo; iptables-restore: unabletoinitializetable & #39; filter & #39; & #39; & rdquo; error. chinese translation: iptables recovery: Unable to initialize the table & ldquo; filter & rdquo ;.

If you partially execute the yum update upgrade or compile the Linux kernel, after the upgrade is completed, the "iptables-restore: unable to initialize table 'filter'" error will occur when you restart or start iptables, iptables recovery: Unable to initialize the table "filter ".

 

The detailed error is as follows:


Applying iptables firewall rules: FATAL: Could not open 'kernel/net/ipv4/netfilter/ip_tables.ko': No such file or directoryiptables-restore v1.4.9: iptables-restore: unable to initialize table 'filter'Error occurred at line: 1Try `iptables-restore -h' or 'iptables-restore --help' for more information.

This is because the system module of iptables is upgraded during Kernel upgrade. The latest module is not loaded, so we can try the following solutions.


1. try to directly load the module
modprobe ip_tablesmodprobe iptable_filter

Manually load the ip_tables and iptables_filter modules. If no error is displayed, it indicates that the module loading is normal. Simply restart iptables.

If the following error is prompted (for example), perform the following operations:

 


2. check whether iptables-related modules exist in the current kernel.
ls -al /lib/modules/`uname -r`/kernel/net/ipv4/netfilter

Run the above command by using SSH and output the following results:

 

If the output result contains the content shown in the above two red boxes, it indicates that there are related modules in the system, but it may not be loaded and needs to be manually loaded. If no content is shown in the box, recompile the kernel.


depmod -a

After loading, load the module again.


modprobe ip_tablesmodprobe iptable_filter

Run the preceding commands by using SSH, re-analyze and load the module, execute the command, and try to start iptables. if so, the startup is successful.


3. a kernel re-compilation method is provided.
Cd/usr/src/linux # enter the source code directory make install # for installation

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.