0

When attempting to use iptables on an Arch install with the default kernel, I'm receiving the error

iptables v1.6.2: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

I have no idea why the module wouldn't be installed, although I did experiment a little with nftables, perhaps that replaced something? Is this message correct and if so how do I go about fixing it?

EDIT: Output of pacman -Qii

Name            : linux
Version         : 4.17.2-1
Description     : The Linux kernel and modules
Architecture    : x86_64
URL             : https://www.kernel.org/
Licenses        : GPL2
Groups          : base
Provides        : None
Depends On      : coreutils  linux-firmware  kmod  mkinitcpio>=0.7
Optional Deps   : crda: to set the correct wireless channels of your country
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 114.63 MiB
Packager        : Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Build Date      : Sat Jun 16 12:08:26 2018
Install Date    : Wed Jun 20 05:02:18 2018
Install Reason  : Explicitly installed
Install Script  : Yes
Validated By    : Signature
Backup Files    :
UNMODIFIED      /etc/mkinitcpio.d/linux.preset
5
  • What is your kernel version? What command do you use? Do you run that as root? Have you restarted your machine after upgrading the kernel? I have linux 4.16.8-1 installed and the module iptable_filter is present on my system.
    – KamilCuk
    Jun 21 '18 at 12:12
  • @KamilCuk 4.16.12-12-1-ARCH I've used both sudo iptables -S and sudo iptables -L. I used modprobe iptables; modprobe iptables_filter; modprobe iptables-filter; modprobe ip_tables all to no avail.
    – stmfunk
    Jun 21 '18 at 15:19
  • It's iptable_filter (without 's'). What folders do you have in /usr/lib/modules, ie. what is the output of ls /usr/lib/modules? Can you search for iptable_filter in /usr/lib/modules, ie. post the output of find /usr/lib/modules/ -name 'iptable_filter.ko.xz'?
    – KamilCuk
    Jun 21 '18 at 18:00
  • Wait, why do you have double 12 in kernel version, ie. 4.16.12-12-1-ARCH? Shouldn't it be 4.16.12-1-ARCH ? You got to have /usr/lib/modules/*/kernel/net/ipv4/netfilter/iptable_filter.ko.xz, it's in the package listing. Have you tried reinstalling core/linux package, ie. pacman -S linux? Do you kernel installed from core repository? Can you post the output of pacman -Qii linux ?
    – KamilCuk
    Jun 21 '18 at 18:04
  • @KamilCuk sorry that's a typo. The search returned /usr/lib/modules/4.17.2-1-ARCH/kernel/net/ipv4/netfilter/iptable_filter.ko.xz. I ran the Qii command. I will edit it into the main question. I can try the install however I am not at my desk until monday.
    – stmfunk
    Jun 22 '18 at 19:03
2

You are running on kernel 4.16.12, but you have updated kernel to 4.17.2. After each kernel upgrade you need to restart your machine.
iptable fails, because it tries to load module iptable_filter, however the file /usr/lib/modules/4.16.12-1-ARCH/kernel/net/ipv4/netfilter/iptable_filter.ko.xz no longer exists, because you have updated your kernel with pacman -S linux. To change the running kernel you need to restart your machine. After restart, if the running kernel as reported by uname -a matches the version that is installed pacman -Q linux, then the iptables command should successfully load iptable_filter module.

1
  • Ah, I have a systemd task that updates at 5am it must have updated the kernel without my knowledge. Thanks!
    – stmfunk
    Jun 25 '18 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.