Forums

Skip to content

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

[SOLVED] IPTABLES rules failed

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
6 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 rules failed

  • Quote

Post by smokyrun » Wed Mar 04, 2026 4:55 am

Hello All,

Last week I upgrade my kernel from the release 6.12.58 to 6.18.12 when I try to apply all my iptables rules I get error messages.
Below information about my configuration :

Code: Select all

root@himalaya ~ # eselect iptables list
Available iptables symlink targets:
  [1]   xtables-legacy-multi
  [2]   xtables-nft-multi *
The 2 USE flags for iptables ebuild

Code: Select all

root@himalaya ~ # cat /etc/portage/package.use/iptables 
net-firewall/iptables nftables conntrack
An extract of my iptables rules :

r

Code: Select all

oot@himalaya ~ # more firerules.29102025 
# Generated by iptables-save v1.8.11 on Wed Oct 29 09:53:44 2025
*nat
:PREROUTING ACCEPT [9:880]
:INPUT ACCEPT [9:880]
:OUTPUT ACCEPT [40:2803]
:POSTROUTING ACCEPT [40:2803]
:LIBVIRT_PRT - [0:0]
-A POSTROUTING -j LIBVIRT_PRT
-A LIBVIRT_PRT -s 192.168.122.0/24 -d 224.0.0.0/24 -j RETURN
-A LIBVIRT_PRT -s 192.168.122.0/24 -d 255.255.255.255/32 -j RETURN
-A LIBVIRT_PRT -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp -j MASQUERADE --to-ports 1024-65535
-A LIBVIRT_PRT -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp -j MASQUERADE --to-ports 1024-65535
-A LIBVIRT_PRT -s 192.168.122.0/24 ! -d 192.168.122.0/24 -j MASQUERADE
COMMIT
Below error message when I try to restore them :

Code: Select all

root@himalaya ~ # iptables-restore < firerules.29102025 
Warning: Extension MASQUERADE revision 0 not supported, missing kernel module?
iptables-restore v1.8.11 (nf_tables): 
line 3: TABLE_ADD failed (Operation not supported): table nat
line 3: CHAIN_ADD failed (No such file or directory): chain PREROUTING
line 3: CHAIN_UPDATE failed (No such file or directory): chain PREROUTING
line 4: TABLE_ADD failed (Operation not supported): table nat
line 4: CHAIN_ADD failed (No such file or directory): chain INPUT
line 4: CHAIN_UPDATE failed (No such file or directory): chain INPUT
line 5: TABLE_ADD failed (Operation not supported): table nat
line 5: CHAIN_ADD failed (No such file or directory): chain OUTPUT
line 5: CHAIN_UPDATE failed (No such file or directory): chain OUTPUT
line 6: TABLE_ADD failed (Operation not supported): table nat
line 6: CHAIN_ADD failed (No such file or directory): chain POSTROUTING
line 6: CHAIN_UPDATE failed (No such file or directory): chain POSTROUTING
line 7: TABLE_ADD failed (Operation not supported): table nat
line 7: CHAIN_USER_ADD failed (No such file or directory): chain LIBVIRT_PRT
line 8: TABLE_ADD failed (Operation not supported): table nat
I know there are some news in the new kernel configuration.

Thank you in advance for your help.

Kind regards,

smokyrun
Last edited by smokyrun on Fri Mar 06, 2026 11:17 am, edited 1 time in total.
Top
Banana
Administrator
Administrator
User avatar
Posts: 2397
Joined: Fri May 21, 2004 12:02 pm
Location: Germany
Contact:
Contact Banana
Website

  • Quote

Post by Banana » Wed Mar 04, 2026 6:57 am

Maybe this topic here can help
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
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 » Wed Mar 04, 2026 9:34 am

Thank you so much for your reply Banana, I'm going to look that.
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 » Fri Mar 06, 2026 11:16 am

Hello All,

I succeeded to fix my iptables problem, on the new kernel config I activated this module

Code: Select all

CONFIG_NETFILTER_XTABLES_LEGACY
, this parameter is a new functionality in the kernel 6.18.xx for the legacy part and activated all netfilter module as in the ancient release of kernel.

Have a nice day.

Kind regards,

smokyrun
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56104
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Fri Mar 06, 2026 12:41 pm

smokyrun,

That CONFIG_NETFILTER_XTABLES_LEGACY option is the first step in removing iptables from the kernel.

You have plenty oy time to migrate to netfilter, if you start planning now.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
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 Mar 07, 2026 6:00 pm

Thank you so much NeddySeagoon for your adivices and these information.

smokyrun
Top
Post Reply

6 posts • Page 1 of 1

Return to “Networking & Security”

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

 

 

magic