Iptables - iptables v1.6.0: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)

Hi,

I am looking to configure connection sharing on a Colibri iMX6. I am building a custom image, which at present has no changes from the toradex V2.7 image. Whenever I issue an iptables command, eg. iptables -L I get the following error,

modprobe: FATAL: Module ip_tables not found in directory /lib/modules/4.1.35-v2.7b1+gc117783
iptables v1.6.0: can’t initialize iptables table `filter’: Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Can anybody point me in the right direction to enable iptables?

Regards,

Alex

It looks like the i.MX6 kernel config is lacking NAT functionality. Adding the following config to your kernel configuration should fix it: CONFIG_IP_NF_IPTABLES.

One can check if this is enabled on the module with

zcat /proc/config.gz | grep -i "NF_IPTABLES"