[DONE] IPTables & Fail2Ban

Discussion in 'Installation/Configuration' started by Neptun, Apr 29, 2020.

  1. Neptun

    Neptun Member

    Dear all,
    i hope somebody could help me.
    I have an setup perfect server for debian 10 with nginx.
    (Linux kernel 5.4.6-xen on x86_64)
    All was working perfect until my hoster updated the kernels of the servers.

    Now my IPTables shows nothing anymore:
    upload_2020-4-29_11-6-39.png

    Before everything was working with all rules what i have applied, ....

    As well my Fail2Ban log is full with this errors - but i cannot find anything to fix it (before everything was fine):

    Code:
    2020-04-29 11:03:46,302 fail2ban.utils [692]: ERROR 7f1e68930d98 -- stderr: "modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/5.4.6-xen/modules.dep.bin'"
    2020-04-29 11:03:46,302 fail2ban.utils [692]: ERROR 7f1e68930d98 -- stderr: 'modprobe: FATAL: Module ip_tables not found in directory /lib/modules/5.4.6-xen'
    2020-04-29 11:03:46,302 fail2ban.utils [692]: ERROR 7f1e68930d98 -- stderr: "iptables v1.8.2 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)"
    2020-04-29 11:03:46,302 fail2ban.utils [692]: ERROR 7f1e68930d98 -- stderr: 'Perhaps iptables or your kernel needs to be upgraded.'
    2020-04-29 11:03:46,302 fail2ban.utils [692]: ERROR 7f1e68930d98 -- returned 1
    2020-04-29 11:03:46,303 fail2ban.CommandAction [692]: ERROR Invariant check failed. Trying to restore a sane environment
    2020-04-29 11:03:46,342 fail2ban.utils [692]: Level 39 7f1e68930d98 -- exec: iptables -w -n -L INPUT | grep -q 'f2b-sshd[ \t]'
    2020-04-29 11:03:46,343 fail2ban.utils [692]: ERROR 7f1e68930d98 -- stderr: "modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/5.4.6-xen/modules.dep.bin'"
    2020-04-29 11:03:46,343 fail2ban.utils [692]: ERROR 7f1e68930d98 -- stderr: 'modprobe: FATAL: Module ip_tables not found in directory /lib/modules/5.4.6-xen'
    2020-04-29 11:03:46,343 fail2ban.utils [692]: ERROR 7f1e68930d98 -- stderr: "iptables v1.8.2 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)"
    2020-04-29 11:03:46,343 fail2ban.utils [692]: ERROR 7f1e68930d98 -- stderr: 'Perhaps iptables or your kernel needs to be upgraded.'
    2020-04-29 11:03:46,343 fail2ban.utils [692]: ERROR 7f1e68930d98 -- returned 1
    2020-04-29 11:03:46,343 fail2ban.CommandAction [692]: CRITICAL Unable to restore environment
    My iptables is latest what is available with Debian 10.

    Thanks in advance
     
    Last edited: Apr 29, 2020
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Have you asked your hoster what to do?
    What was the kernel before and what is it now?
    If you run as root
    Code:
    apt update
    apt dist-upgrade
    Does it do anything? Has rebooting been tried?
     
  3. Neptun

    Neptun Member

    I have not asked my hoster to do it - they do this regular to have always up to date systems, what is in total perfect.
    (this was done at the main server, which is shared with other clients too)

    why i should do dist-upgrade?
    i have already the latest release of debian 10 installed

    to restart the server & reboot all service had also not helped/fixed anything
    as well i have not changed anything at the server settings, until this happened (before the kernel upgrade, everything was perfect working - without any issue)

    i had also searched everywhere for a fix - but nothing found to get it working again
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What shows
    Code:
    uname -a
    Reading the error message, does the file
    Code:
    /lib/modules/5.4.6-xen/modules.dep.bin
    exist?
     
  5. Neptun

    Neptun Member

    uname -a shows:
    Code:
    Linux manager0101 5.4.6-xen #546 SMP Wed Dec 25 17:46:43 CET 2019 x86_64 GNU/Linux
    /lib/modules/ is empty with not any folder
    i think that here an kernel update of my installed debian 10 server setup is needed, that it works together
     
    Last edited: Apr 29, 2020
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I still say you should contact your hoster. If they update kernel, they should provide the /lib/modules for that kernel also. Or they have some trick to make the system work without those files.
    On the other hand, if /lib/modules is empty, then the previous kernel did not have modules either. So somehow it worked. I do not know how. What kind of setup is your host, anyway?
     
  7. Neptun

    Neptun Member

    I have written them half an hour ago - because i think for 98% that it is something with the kernel - everything other makes no sense, as well is no mistake in the setup, i have double checked everything & the ispconfig panel also gives no other errors or warning messages - everything green.
    The host systems are really good at this hoster - nvme ssd pcie raid 10 server incl ssd swap with xeon gold 6154 cpu 3 ghz & more than enough ecc ram
     

Share This Page