# Can't get NAT to work after kernel upgrade [SOLVED]

## Iron_DragonLord

Hi I'm typing this from a links page as my desktop can no longer get online.

My previous kernel was Gentoo Sources 2.6.17-r8, I've updated to 2.6.23-r3. I copied my .config to the new directory and ran make menuconfig and verified things, they appeared fine.

I've also done an emerge -uDN world.

After I reboot, now iptables refuses to load my policies/tables. I get this error:

FATAL: Module ip_tables not found.

iptables-restore v1.3.8: iptables-restore: unable to initialize table 'nat' 

Error occured at line: 2

Luckily I've recovered my rules, just can't seem to load them.

For some reason my nat table won't work. I've tried going through the menu config and enabling all the networking items, and it still refuses to give me my NAT.

Ideas? Please?Last edited by Iron_DragonLord on Sun Jan 27, 2008 12:09 am; edited 1 time in total

----------

## Jaglover

Generally, if you build something from source reading README and INSTALL (if present) files is a must. Makefile is worth a look, too.

----------

## Hu

Have you enabled NAT in the new kernel?  There were quite a few configuration changes between those versions.

What is the output of zgrep -E '^[^#]' /proc/config.gz for the failing kernel?

----------

## xtz

 *Iron_DragonLord wrote:*   

> My previous kernel was Gentoo Sources 2.6.17-r8, I've updated to 2.6.23-r3. I copied my .config to the new directory and ran make menuconfig and verified things, they appeared fine.
> 
> 

 

cd /usr/src/linux

make modules_install

update-modules

----------

## Iron_DragonLord

Hi everyone, thanks for the replies I would like to get myself back online ASAP. Server command line isn't the easiest.  :Smile: 

 *Quote:*   

> Generally, if you build something from source reading README and INSTALL (if present) files is a must. Makefile is worth a look, too.

 I've been depending too much on Portage's package messages after emerging files, I suppose.

 *Quote:*   

> Have you enabled NAT in the new kernel? There were quite a few configuration changes between those versions. 
> 
> What is the output of zgrep -E '^[^#]' /proc/config.gz for the failing kernel?

 This is the problem! I can't seem to find NAT in the new kernel. But I've checked for all the netfilter options and related. Here's that output:

```
server ~ # zgrep -E '^[^#]' /proc/config.gz

CONFIG_X86_32=y

CONFIG_GENERIC_TIME=y

CONFIG_GENERIC_CMOS_UPDATE=y

CONFIG_CLOCKSOURCE_WATCHDOG=y

CONFIG_GENERIC_CLOCKEVENTS=y

CONFIG_LOCKDEP_SUPPORT=y

CONFIG_STACKTRACE_SUPPORT=y

CONFIG_SEMAPHORE_SLEEPERS=y

CONFIG_X86=y

CONFIG_MMU=y

CONFIG_ZONE_DMA=y

CONFIG_QUICKLIST=y

CONFIG_GENERIC_ISA_DMA=y

CONFIG_GENERIC_IOMAP=y

CONFIG_GENERIC_BUG=y

CONFIG_GENERIC_HWEIGHT=y

CONFIG_ARCH_MAY_HAVE_PC_FDC=y

CONFIG_DMI=y

CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

CONFIG_EXPERIMENTAL=y

CONFIG_BROKEN_ON_SMP=y

CONFIG_INIT_ENV_ARG_LIMIT=32

CONFIG_LOCALVERSION=""

CONFIG_SWAP=y

CONFIG_SYSVIPC=y

CONFIG_SYSVIPC_SYSCTL=y

CONFIG_IKCONFIG=y

CONFIG_IKCONFIG_PROC=y

CONFIG_LOG_BUF_SHIFT=14

CONFIG_CC_OPTIMIZE_FOR_SIZE=y

CONFIG_SYSCTL=y

CONFIG_UID16=y

CONFIG_SYSCTL_SYSCALL=y

CONFIG_KALLSYMS=y

CONFIG_HOTPLUG=y

CONFIG_PRINTK=y

CONFIG_BUG=y

CONFIG_ELF_CORE=y

CONFIG_BASE_FULL=y

CONFIG_FUTEX=y

CONFIG_ANON_INODES=y

CONFIG_EPOLL=y

CONFIG_SIGNALFD=y

CONFIG_EVENTFD=y

CONFIG_SHMEM=y

CONFIG_VM_EVENT_COUNTERS=y

CONFIG_SLUB_DEBUG=y

CONFIG_SLUB=y

CONFIG_RT_MUTEXES=y

CONFIG_BASE_SMALL=0

CONFIG_MODULES=y

CONFIG_MODULE_UNLOAD=y

CONFIG_MODULE_FORCE_UNLOAD=y

CONFIG_KMOD=y

CONFIG_BLOCK=y

CONFIG_IOSCHED_NOOP=y

CONFIG_IOSCHED_DEADLINE=y

CONFIG_DEFAULT_DEADLINE=y

CONFIG_DEFAULT_IOSCHED="deadline"

CONFIG_X86_PC=y

CONFIG_MK6=y

CONFIG_X86_CMPXCHG=y

CONFIG_X86_L1_CACHE_SHIFT=5

CONFIG_X86_XADD=y

CONFIG_RWSEM_XCHGADD_ALGORITHM=y

CONFIG_GENERIC_CALIBRATE_DELAY=y

CONFIG_X86_WP_WORKS_OK=y

CONFIG_X86_INVLPG=y

CONFIG_X86_BSWAP=y

CONFIG_X86_POPAD_OK=y

CONFIG_X86_ALIGNMENT_16=y

CONFIG_X86_USE_PPRO_CHECKSUM=y

CONFIG_X86_TSC=y

CONFIG_X86_MINIMUM_CPU_FAMILY=4

CONFIG_HPET_TIMER=y

CONFIG_HPET_EMULATE_RTC=y

CONFIG_PREEMPT_NONE=y

CONFIG_X86_MCE=y

CONFIG_VM86=y

CONFIG_NOHIGHMEM=y

CONFIG_PAGE_OFFSET=0xC0000000

CONFIG_ARCH_FLATMEM_ENABLE=y

CONFIG_ARCH_SPARSEMEM_ENABLE=y

CONFIG_ARCH_SELECT_MEMORY_MODEL=y

CONFIG_ARCH_POPULATES_NODE_MAP=y

CONFIG_SELECT_MEMORY_MODEL=y

CONFIG_FLATMEM_MANUAL=y

CONFIG_FLATMEM=y

CONFIG_FLAT_NODE_MEM_MAP=y

CONFIG_SPARSEMEM_STATIC=y

CONFIG_SPLIT_PTLOCK_CPUS=4

CONFIG_ZONE_DMA_FLAG=1

CONFIG_BOUNCE=y

CONFIG_NR_QUICK=1

CONFIG_VIRT_TO_BUS=y

CONFIG_MTRR=y

CONFIG_HZ_100=y

CONFIG_HZ=100

CONFIG_PHYSICAL_START=0x100000

CONFIG_PHYSICAL_ALIGN=0x100000

CONFIG_PM=y

CONFIG_PM_LEGACY=y

CONFIG_SUSPEND_UP_POSSIBLE=y

CONFIG_HIBERNATION_UP_POSSIBLE=y

CONFIG_PCI=y

CONFIG_PCI_GOANY=y

CONFIG_PCI_BIOS=y

CONFIG_PCI_DIRECT=y

CONFIG_ISA_DMA_API=y

CONFIG_BINFMT_ELF=y

CONFIG_NET=y

CONFIG_PACKET=y

CONFIG_PACKET_MMAP=y

CONFIG_UNIX=y

CONFIG_XFRM=y

CONFIG_INET=y

CONFIG_IP_MULTICAST=y

CONFIG_IP_ADVANCED_ROUTER=y

CONFIG_ASK_IP_FIB_HASH=y

CONFIG_IP_FIB_HASH=y

CONFIG_NET_IPIP=m

CONFIG_IP_MROUTE=y

CONFIG_INET_TUNNEL=m

CONFIG_INET_XFRM_MODE_TRANSPORT=m

CONFIG_INET_XFRM_MODE_TUNNEL=m

CONFIG_INET_XFRM_MODE_BEET=m

CONFIG_INET_DIAG=m

CONFIG_INET_TCP_DIAG=m

CONFIG_TCP_CONG_CUBIC=y

CONFIG_DEFAULT_TCP_CONG="cubic"

CONFIG_NETFILTER=y

CONFIG_BRIDGE_NETFILTER=y

CONFIG_NETFILTER_NETLINK=m

CONFIG_NF_CONNTRACK_ENABLED=y

CONFIG_NF_CONNTRACK=y

CONFIG_NF_CT_ACCT=y

CONFIG_NF_CONNTRACK_MARK=y

CONFIG_NF_CT_PROTO_GRE=m

CONFIG_NF_CT_PROTO_SCTP=m

CONFIG_NF_CT_PROTO_UDPLITE=m

CONFIG_NF_CONNTRACK_AMANDA=m

CONFIG_NF_CONNTRACK_FTP=m

CONFIG_NF_CONNTRACK_H323=m

CONFIG_NF_CONNTRACK_IRC=m

CONFIG_NF_CONNTRACK_NETBIOS_NS=m

CONFIG_NF_CONNTRACK_PPTP=m

CONFIG_NF_CONNTRACK_SANE=m

CONFIG_NF_CONNTRACK_SIP=m

CONFIG_NF_CONNTRACK_TFTP=m

CONFIG_NETFILTER_XTABLES=y

CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m

CONFIG_NETFILTER_XT_TARGET_CONNMARK=m

CONFIG_NETFILTER_XT_TARGET_DSCP=m

CONFIG_NETFILTER_XT_TARGET_MARK=m

CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m

CONFIG_NETFILTER_XT_TARGET_NFLOG=m

CONFIG_NETFILTER_XT_TARGET_NOTRACK=m

CONFIG_NETFILTER_XT_TARGET_TRACE=m

CONFIG_NETFILTER_XT_TARGET_TCPMSS=m

CONFIG_NETFILTER_XT_MATCH_COMMENT=m

CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m

CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m

CONFIG_NETFILTER_XT_MATCH_CONNMARK=m

CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m

CONFIG_NETFILTER_XT_MATCH_DCCP=m

CONFIG_NETFILTER_XT_MATCH_DSCP=m

CONFIG_NETFILTER_XT_MATCH_ESP=m

CONFIG_NETFILTER_XT_MATCH_HELPER=m

CONFIG_NETFILTER_XT_MATCH_LENGTH=m

CONFIG_NETFILTER_XT_MATCH_LIMIT=y

CONFIG_NETFILTER_XT_MATCH_MAC=y

CONFIG_NETFILTER_XT_MATCH_MARK=m

CONFIG_NETFILTER_XT_MATCH_POLICY=m

CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m

CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m

CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m

CONFIG_NETFILTER_XT_MATCH_QUOTA=m

CONFIG_NETFILTER_XT_MATCH_REALM=m

CONFIG_NETFILTER_XT_MATCH_SCTP=m

CONFIG_NETFILTER_XT_MATCH_STATE=m

CONFIG_NETFILTER_XT_MATCH_STATISTIC=m

CONFIG_NETFILTER_XT_MATCH_STRING=m

CONFIG_NETFILTER_XT_MATCH_TCPMSS=m

CONFIG_NETFILTER_XT_MATCH_U32=m

CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m

CONFIG_IP_NF_IPTABLES=y

CONFIG_IP_NF_MATCH_IPRANGE=y

CONFIG_IP_NF_MATCH_TOS=y

CONFIG_IP_NF_MATCH_RECENT=y

CONFIG_IP_NF_MATCH_ECN=y

CONFIG_IP_NF_MATCH_AH=y

CONFIG_IP_NF_MATCH_TTL=y

CONFIG_IP_NF_MATCH_OWNER=y

CONFIG_IP_NF_MATCH_ADDRTYPE=y

CONFIG_IP_NF_FILTER=y

CONFIG_IP_NF_TARGET_REJECT=y

CONFIG_IP_NF_TARGET_LOG=y

CONFIG_IP_NF_TARGET_ULOG=y

CONFIG_IP_NF_MANGLE=y

CONFIG_IP_NF_TARGET_TOS=y

CONFIG_IP_NF_TARGET_ECN=y

CONFIG_IP_NF_TARGET_TTL=y

CONFIG_IP_NF_RAW=y

CONFIG_IP_NF_ARPTABLES=y

CONFIG_IP_NF_ARPFILTER=y

CONFIG_IP_NF_ARP_MANGLE=y

CONFIG_BRIDGE=y

CONFIG_LLC=y

CONFIG_NET_CLS_ROUTE=y

CONFIG_WIRELESS_EXT=y

CONFIG_STANDALONE=y

CONFIG_PREVENT_FIRMWARE_BUILD=y

CONFIG_BLK_DEV=y

CONFIG_BLK_DEV_FD=m

CONFIG_BLK_DEV_LOOP=m

CONFIG_BLK_DEV_CRYPTOLOOP=m

CONFIG_IDE=y

CONFIG_BLK_DEV_IDE=y

CONFIG_BLK_DEV_IDEDISK=y

CONFIG_IDEDISK_MULTI_MODE=y

CONFIG_BLK_DEV_IDECD=m

CONFIG_IDE_PROC_FS=y

CONFIG_BLK_DEV_IDEPCI=y

CONFIG_IDEPCI_PCIBUS_ORDER=y

CONFIG_BLK_DEV_IDEDMA_PCI=y

CONFIG_BLK_DEV_VIA82CXXX=y

CONFIG_BLK_DEV_IDEDMA=y

CONFIG_NETDEVICES=y

CONFIG_NET_ETHERNET=y

CONFIG_MII=y

CONFIG_NET_TULIP=y

CONFIG_TULIP=y

CONFIG_NET_PCI=y

CONFIG_SUNDANCE=m

CONFIG_SUNDANCE_MMIO=y

CONFIG_INPUT=y

CONFIG_INPUT_MOUSEDEV=y

CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024

CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768

CONFIG_INPUT_KEYBOARD=y

CONFIG_KEYBOARD_ATKBD=y

CONFIG_SERIO=y

CONFIG_SERIO_I8042=y

CONFIG_SERIO_LIBPS2=y

CONFIG_VT=y

CONFIG_VT_CONSOLE=y

CONFIG_HW_CONSOLE=y

CONFIG_SERIAL_8250=y

CONFIG_FIX_EARLYCON_MEM=y

CONFIG_SERIAL_8250_PCI=y

CONFIG_SERIAL_8250_NR_UARTS=4

CONFIG_SERIAL_8250_RUNTIME_UARTS=4

CONFIG_SERIAL_CORE=y

CONFIG_UNIX98_PTYS=y

CONFIG_RTC=y

CONFIG_DEVPORT=y

CONFIG_HWMON=m

CONFIG_VGA_CONSOLE=y

CONFIG_DUMMY_CONSOLE=y

CONFIG_RTC_LIB=y

CONFIG_RTC_CLASS=y

CONFIG_RTC_HCTOSYS=y

CONFIG_RTC_HCTOSYS_DEVICE="rtc0"

CONFIG_RTC_INTF_SYSFS=y

CONFIG_RTC_INTF_PROC=y

CONFIG_RTC_INTF_DEV=y

CONFIG_EXT2_FS=y

CONFIG_EXT3_FS=m

CONFIG_EXT3_FS_XATTR=y

CONFIG_JBD=m

CONFIG_FS_MBCACHE=y

CONFIG_REISERFS_FS=y

CONFIG_INOTIFY=y

CONFIG_INOTIFY_USER=y

CONFIG_DNOTIFY=y

CONFIG_AUTOFS4_FS=y

CONFIG_ISO9660_FS=m

CONFIG_JOLIET=y

CONFIG_ZISOFS=y

CONFIG_FAT_FS=m

CONFIG_MSDOS_FS=m

CONFIG_VFAT_FS=m

CONFIG_FAT_DEFAULT_CODEPAGE=850

CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"

CONFIG_PROC_FS=y

CONFIG_PROC_KCORE=y

CONFIG_PROC_SYSCTL=y

CONFIG_SYSFS=y

CONFIG_TMPFS=y

CONFIG_RAMFS=y

CONFIG_NFS_FS=m

CONFIG_NFS_V3=y

CONFIG_NFSD=m

CONFIG_NFSD_V3=y

CONFIG_NFSD_TCP=y

CONFIG_LOCKD=m

CONFIG_LOCKD_V4=y

CONFIG_EXPORTFS=m

CONFIG_NFS_COMMON=y

CONFIG_SUNRPC=m

CONFIG_CIFS=m

CONFIG_MSDOS_PARTITION=y

CONFIG_NLS=y

CONFIG_NLS_DEFAULT="iso8859-15"

CONFIG_NLS_CODEPAGE_437=y

CONFIG_NLS_ISO8859_1=y

CONFIG_NLS_UTF8=y

CONFIG_TRACE_IRQFLAGS_SUPPORT=y

CONFIG_DEBUG_BUGVERBOSE=y

CONFIG_EARLY_PRINTK=y

CONFIG_DOUBLEFAULT=y

CONFIG_CRYPTO=y

CONFIG_CRYPTO_ALGAPI=m

CONFIG_CRYPTO_BLKCIPHER=m

CONFIG_CRYPTO_MANAGER=m

CONFIG_CRYPTO_ECB=m

CONFIG_CRYPTO_CBC=m

CONFIG_CRYPTO_PCBC=m

CONFIG_CRYPTO_HW=y

CONFIG_CRYPTO_DEV_GEODE=m

CONFIG_BITREVERSE=y

CONFIG_CRC32=y

CONFIG_ZLIB_INFLATE=m

CONFIG_TEXTSEARCH=y

CONFIG_TEXTSEARCH_KMP=m

CONFIG_TEXTSEARCH_BM=m

CONFIG_TEXTSEARCH_FSM=m

CONFIG_PLIST=y

CONFIG_HAS_IOMEM=y

CONFIG_HAS_IOPORT=y

CONFIG_HAS_DMA=y

CONFIG_GENERIC_HARDIRQS=y

CONFIG_GENERIC_IRQ_PROBE=y

CONFIG_X86_BIOS_REBOOT=y

CONFIG_KTIME_SCALAR=y
```

 *Quote:*   

> cd /usr/src/linux 
> 
> make modules_install 
> 
> update-modules

 

Hi, I've already ran "make && make modules && make modules_install && make install", followed by "update-modules --force" (had to force, it wasn't generated yet, we're talking updating a system set up 1-2 years ago)

Let me know any other ideas, thanks.

----------

## Hu

You must enable CONFIG_NF_CONNTRACK_IPV4 if you want to enable CONFIG_NF_NAT (Full NAT).  There are some other requirements, but that is the only one which your current config does not satisfy.

----------

## Iron_DragonLord

 *Hu wrote:*   

> You must enable CONFIG_NF_CONNTRACK_IPV4 if you want to enable CONFIG_NF_NAT (Full NAT).  There are some other requirements, but that is the only one which your current config does not satisfy.

  Hi thank you so much for the reply. I could have sworn I had it enabled, at least on my old kernel.

At first that option wasn't enbled, I had to go under the one above IP netfilter and enable conntracking, then go back down and it showed up.

I'm recompiling now, but it should work. Thanks again.

Now to investigate my kernel newfound panics on boot...

----------

## Iron_DragonLord

Hmmm, no go. It's enbled for sure now but still no NAT. Maybe I need to recompile iptables. I'll try emerging it again...

Any other ideas?

----------

## Iron_DragonLord

Finally, I got it. There's another "FULL_NAT" option somewhere in the goliath of options I had to find.

Also had to compile the state module to get my routing functions working.

Totally wiggy.

Anyway, all working fine. Thanks for all the help

----------

## henri

Ouhhuhu, sorry, this was really easy  :Wink: 

If you forget to set CONFIG_NF_CONNTRACK_IPV4, the FULL_NAT options will not appear.

I forgot it  :Smile:  - Now everything is selectable like expected again.

Yours Henri

----------

