iptables - why do I get "Table does not exist (do you need to insmod?)"

12,329

You should be able to re-compile it using something to the similar commands.

make KERNEL_DIR=/usr/src/linux
make install KERNEL_DIR=/usr/src/linux

make dep
make bzIamge
make
make install
make modules

Source: iptables: Table does not exist (do you need to insmod?)

Share:
12,329

Related videos on Youtube

stdcerr
Author by

stdcerr

Coding mostly on embedded systems (24/7/365 uptime) to make a living at daytime, coding on a variety of systems (x86, arm) for fun at nighttime, preferences: Linux, C & C++. Always interested in learning other ways/better ways to solve problems!

Updated on September 18, 2022

Comments

  • stdcerr
    stdcerr over 1 year

    I need to install some iptable ruels to block traffic that originates from a certain country, I found this script example on http://www.cyberciti.biz/faq/block-entier-country-using-iptables/ it works great on another host I have but on this one (an embedded box) I get:

    ./iptable_rules.sh 
    modprobe: module ip_tables not found in modules.dep
    iptables v1.4.16.3: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
    Perhaps iptables or your kernel needs to be upgraded.
    

    Now upgrading the kernel due to the nature of the device, is not an option. Does anyone know a way I can get around this? This system running on kernel 3.2.34

    • Bytor
      Bytor over 8 years
      Are you running the script (and thus iptables itself) as root or as a normal user? It will complain about many similar things if you are not running it as root.
    • stdcerr
      stdcerr over 8 years
      @bytor I'm running it as root, must be something else...
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' over 8 years
      Do you have the kernel configuration? If so you can compile and load the requisite module (assuming module loading hasn't been disabled).
    • neuron
      neuron over 8 years
      try lsmod | grep ip , what do you get ?
    • stdcerr
      stdcerr over 8 years
      @neuron I get nothing: # lsmod |grep ip \n# , I have to see if I can dig the kernel configuration up, it's a busybox distribution I built way back when using Buildroot
    • neuron
      neuron over 8 years
      modprobe ip_tables; modprobe ip_conntrack; modprobe iptable_filter; modprobe ipt_state. If the modules are not loaded after this then you will have to do as @Gilles said
    • larsks
      larsks over 8 years
      It looks like iptables simply isn't available on your embedded device.
    • neuron
      neuron over 8 years
      Try following this article