Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

[SOLVED] IPTABLES failed after kernel upgrade

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
smokyrun
Tux's lil' helper
Tux's lil' helper
Posts: 85
Joined: Tue Dec 26, 2023 2:00 pm
Location: Reunion Island

[SOLVED] IPTABLES failed after kernel upgrade

  • Quote

Post by smokyrun » Sat Feb 28, 2026 11:33 am

Hello All,

Yesterday I updated my kernel from the 6.12.58 release to the 6.18.12 but after that my VPN did'nt work because some kernel modules does'nt exist in the new kernel release :

I get this error message when I would want to use IPTABLES :

Code: Select all

modprobe: FATAL: Module ip_tables not found in directory /lib/modules/6.18.12-gentoo
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Below the different between the 2 kernel version about iptables modules :
root@himalaya /boot # grep -i IPTABLES /boot/config-6.18.12-gentoo
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP6_NF_IPTABLES=y
# iptables trigger is under Netfilter config (LED target)

root@himalaya /boot # grep -i IPTABLES /boot/config-6.12.58-gentoo
CONFIG_IP_NF_IPTABLES_LEGACY=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP6_NF_IPTABLES_LEGACY=y
CONFIG_IP6_NF_IPTABLES=y
# iptables trigger is under Netfilter config (LED target)
Do you if there is an issue to fix this problem ?

Thank you so much for your help.

smokyrun
Last edited by smokyrun on Sat Feb 28, 2026 4:30 pm, edited 2 times in total.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56073
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sat Feb 28, 2026 11:42 am

smokyrun,

You are missing the _LEGACY optins.
Go into menuconfig.
Press the 'z' key.
Search for the option.
Read it's help.
The Depends on: boolean must be true befbre the optioneis visible.
Fix that, then select the _LEGACY option.

'z' toggles the display of hidden options and allows search to find them.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
grknight
Retired Dev
Retired Dev
Posts: 2549
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Sat Feb 28, 2026 1:16 pm

Alternatively, enable the nftables USE on net-firewall/iptables and rebuild with --oneshot (or a world update).
Then, use eselect iptables to choose the non-legacy option.

This is the best way to not chase kernel options going forward.
Last edited by grknight on Sat Feb 28, 2026 1:59 pm, edited 1 time in total.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56073
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sat Feb 28, 2026 1:54 pm

To add to what grknight said,

iptables will go away one day, so you will be forced to move.
You can pick your day at the moment.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Sat Feb 28, 2026 2:22 pm

smokyrun,

CONFIG_NETFILTER_XTABLES_LEGACY was created with 6.17:
https://wiki.gentoo.org/wiki/User:Pieti ... 16_to_6.17
https://wiki.gentoo.org/wiki/User:Pietinger --> https://wiki.gentoo.org/wiki/User:Pieti ... _at_Gentoo
Top
smokyrun
Tux's lil' helper
Tux's lil' helper
Posts: 85
Joined: Tue Dec 26, 2023 2:00 pm
Location: Reunion Island

  • Quote

Post by smokyrun » Sat Feb 28, 2026 4:26 pm

Thank you so much for all these precious information and your help, I learned many things today about kernel.
Now I understand why the "_LEGACY" options didn't appear in the new kernel configuration in despite of the using the directive "make oldefconfig" before to compile the new kernel.
I fixed my problem by activating the LEGACY option in the kernel but I think I'm going to use solution recommends by grknight.

Have a nice day.

Kind regards

smokyrun
Top
gtwrek
Tux's lil' helper
Tux's lil' helper
Posts: 113
Joined: Fri Mar 10, 2017 4:28 pm
Location: San Jose, CA

  • Quote

Post by gtwrek » Thu Mar 05, 2026 1:49 am

I just ran into this exact same issue. Funny my google searching with added tag site:gentoo.org never found this thread.
I struggles with a lot of non-gentoo search responses, before I figured things out. Came here to add a post to try and help others, and found this thread.

Adding some more details here (+maybe improve search results):
The errors you may get involve failure to insert some kernel modules, or similar

"ip_tables not found in directory /lib/modules/..."
iptables vN.P.Q: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.

I had to take at attempt or two to get the kernel configuration correct. I think these were the key ones that needed to be enabled, that were missing after 6.18.12:

CONFIG_NETFILTER_XTABLES_LEGACY=y
CONFIG_NETFILTER_XT_TARGET_NETMAP=m
CONFIG_NETFILTER_XT_TARGET_REDIRECT=m
CONFIG_IP_NF_IPTABLES_LEGACY=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP6_NF_IPTABLES_LEGACY=m
CONFIG_IP6_NF_MANGLE=m

(My entire kernel .config diff is a little larger - I've tried to snip out irrelevant stuff that I may have added in my fumbling around trying to resolve the issue)

The gentoo wiki probably needs to add a few new requirements under https://wiki.gentoo.org/wiki/Iptables now that it appears the kernel is moving more aggressively away from this legacy method.
Top
Post Reply

7 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy