Forums

Skip to content

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

can't initialize iptables table `nat'[solved]

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
Adel Ahmed
Veteran
Veteran
Posts: 1616
Joined: Fri Sep 21, 2012 7:59 am

can't initialize iptables table `nat'[solved]

  • Quote

Post by Adel Ahmed » Fri Jan 30, 2015 12:24 am

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

localhost linux # modprobe nf_nat_ipv4
localhost linux # lsmod | grep -i nf_nat
nf_nat_ipv4 2897 0
nf_nat 9938 1 nf_nat_ipv4
nf_conntrack 49468 3 nf_nat,nf_nat_ipv4,nf_conntrack_ipv4

localhost linux # iptables -tnat -L
iptables v1.4.21: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.


this started happening when I upgraded from 3.16.5 to 3.17.7

thanks
Last edited by Adel Ahmed on Wed Feb 04, 2015 12:09 am, edited 1 time in total.
Top
wannagios
n00b
n00b
Posts: 1
Joined: Fri Jan 30, 2015 5:31 am

  • Quote

Post by wannagios » Fri Jan 30, 2015 5:33 am

如果执行 iptable -L 出现以下信息,那么就需要重新配置和编译内核:
iptables v1.4.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.

配置选项:
Networking —->
Networking options —->
[*] Network packet filtering (replaces ipchains) —>
Core Netfilter Configuration —>
<*> Netfilter Xtables support (required for ip_tables)
IP: Netfilter Configuration —>
<*> Connection tracking (required for masq/NAT)
<*> IP tables support (required for filtering/masq/NAT)
<*> IP range match support
<*> Packet filtering
<*> REJECT target support
<*> Full NAT
Top
lost+found
Guru
Guru
User avatar
Posts: 514
Joined: Mon Nov 15, 2004 6:56 pm
Location: North~Sea~Coa~s~~t~~~

  • Quote

Post by lost+found » Fri Jan 30, 2015 7:01 am

You probably miss one of these:
/lib/modules/3.17.7-gentoo/kernel/net/netfilter/nf_nat.ko
/lib/modules/3.17.7-gentoo/kernel/net/netfilter/nf_nat_ftp.ko
/lib/modules/3.17.7-gentoo/kernel/net/netfilter/xt_nat.ko
/lib/modules/3.17.7-gentoo/kernel/net/ipv4/netfilter/nf_nat_ipv4.ko
/lib/modules/3.17.7-gentoo/kernel/net/ipv4/netfilter/iptable_nat.ko

There were some changes in menuconfig between these kernel versions, so you might check there.

Cheers
Top
toralf
Developer
Developer
User avatar
Posts: 3944
Joined: Sun Feb 01, 2004 2:58 pm
Location: Hamburg
Contact:
Contact toralf
Website

  • Quote

Post by toralf » Fri Jan 30, 2015 10:40 am

There were some pain with changed ip tables module names in the past.
If kernel menuconfig options were changed/moved in tis area you could just press "y" within

Code: Select all

make oldconfig
as often as you just asked for additional sub-menus to let the kernel configurator dive into the (new) menu structure.
Top
acmondor
n00b
n00b
Posts: 69
Joined: Fri Aug 08, 2014 10:21 pm
Location: Canadian Prairies

  • Quote

Post by acmondor » Mon Feb 02, 2015 2:42 pm

I ran into this problem earlier this year when I upgraded to 3.17.7. The problem is due to a new/changed config symbol. Prior to 3.17.7 CONFIG_NF_NAT was all that was required to enable NAT support. Now you need to use CONFIG_IP_NF_NAT as shown below from the 'make menuconfig' search NF_NAT result:

Code: Select all

 Symbol: IP_NF_NAT [=y] 
  │ Type  : tristate
  │ Prompt: iptables NAT support
  │   Location:
  │     -> Networking support (NET [=y]) 
  │       -> Networking options            
  │         -> Network packet filtering framework (Netfilter) (NETFILTER [=y]) 
  │           -> IP: Netfilter Configuration                                                            
  │ (2)         -> IP tables support (required for filtering/masq/NAT) (IP_NF_IPTABLES [=y])
  │   Defined at net/ipv4/netfilter/Kconfig:219                                                                     
  │   Depends on: NET [=y] && INET [=y] && NETFILTER [=y] && IP_NF_IPTABLES [=y] && NF_CONNTRACK_IPV4 [=y]
  │   Selects: NF_NAT [=y] && NF_NAT_IPV4 [=y] && NETFILTER_XT_NAT [=y]


I always use 'make oldconfig' when I do kernel upgrades and that is usually sufficient, but this time around I had to run 'make menuconfig' afterwards to re-enable NAT.
Top
Adel Ahmed
Veteran
Veteran
Posts: 1616
Joined: Fri Sep 21, 2012 7:59 am

  • Quote

Post by Adel Ahmed » Wed Feb 04, 2015 12:03 am

thanks everyone
enabling CONFIG_IP_NF_NAT solved everything
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