I was excited when I saw that iptables was compiled into the kernel, but dismayed to discover that it didn't include iptables_nat (and associated modules).
First I followed the howto guide at http://www.readynas.com/?p=145 for "Setting up a ReadyNAS Development Environment" and apt-get'ed:
apt-get update
apt-get install libc6-dev
apt-get install gcc
Next, I downloaded the GPL dist RNDP6xxx_4.2.5_WW (yes I'm running 4.2.5), configured the kernel to include the necessary modules as loadable modules and built the kernel and configured modules. I copied the built modules to:
/lib/modules/2.6.27.6.RNx86.2.1/kernel/net/ipv4/netfilter/iptable_nat.ko
/lib/modules/2.6.27.6.RNx86.2.1/kernel/net/ipv4/netfilter/ipt_MASQUERADE.ko
/lib/modules/2.6.27.6.RNx86.2.1/kernel/net/ipv4/netfilter/nf_conntrack_ipv4.ko
/lib/modules/2.6.27.6.RNx86.2.1/kernel/net/ipv4/netfilter/nf_nat.ko
/lib/modules/2.6.27.6.RNx86.2.1/kernel/net/netfilter/nf_conntrack.ko
ran 'depmod' and tried to do a 'modprobe':
FATAL: Error inserting nf_conntrack (/lib/modules/2.6.27.6.RNx86.2.1/kernel/net/netfilter/nf_conntrack.ko): Unknown symbol in module, or unknown parameter (see dmesg)
'dmesg' tells me:
nf_conntrack: disagrees about version of symbol skb_copy_bits
nf_conntrack: Unknown symbol skb_copy_bits
nf_conntrack: disagrees about version of symbol nf_afinfo
nf_conntrack: Unknown symbol nf_afinfo
nf_conntrack: Unknown symbol nf_conntrack_destroy
nf_conntrack: Unknown symbol nf_ct_destroy
nf_conntrack: disagrees about version of symbol nf_log_packet
nf_conntrack: Unknown symbol nf_log_packet
nf_conntrack: Unknown symbol ip_ct_attach
So I'm guessing that the version of the kernel that my ReadyNAS is running does not correspond to the one that I can build from the RNDP6xxx_4.2.5_WW distribution.
Just to check that I hadn't comletely messed things up, I did a diff between the config file found in arch/x86/configs (are described in this forum thread: viewtopic.php?f=35&t=26164&hilit=arch%2Fx86) and mine:
nas01:/usr/src/linux# diff .config arch/x86/configs/i386_defconfig
4c4
< # Thu Jun 11 07:49:02 2009
---
> # Wed Jan 14 11:49:25 2009
464,480c464
< CONFIG_NF_CONNTRACK=m
< # CONFIG_NF_CT_ACCT is not set
< # CONFIG_NF_CONNTRACK_MARK is not set
< # CONFIG_NF_CONNTRACK_EVENTS is not set
< # CONFIG_NF_CT_PROTO_DCCP is not set
< # CONFIG_NF_CT_PROTO_SCTP is not set
< # CONFIG_NF_CT_PROTO_UDPLITE is not set
< # CONFIG_NF_CONNTRACK_AMANDA is not set
< # CONFIG_NF_CONNTRACK_FTP is not set
< # CONFIG_NF_CONNTRACK_H323 is not set
< # CONFIG_NF_CONNTRACK_IRC is not set
< # CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
< # CONFIG_NF_CONNTRACK_PPTP is not set
< # CONFIG_NF_CONNTRACK_SANE is not set
< # CONFIG_NF_CONNTRACK_SIP is not set
< # CONFIG_NF_CONNTRACK_TFTP is not set
< # CONFIG_NF_CT_NETLINK is not set
---
> # CONFIG_NF_CONNTRACK is not set
489,492d472
< # CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
< # CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set
< # CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set
< # CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
496d475
< # CONFIG_NETFILTER_XT_MATCH_HELPER is not set
509d487
< # CONFIG_NETFILTER_XT_MATCH_STATE is not set
520,521d497
< CONFIG_NF_CONNTRACK_IPV4=m
< # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set
533,545d508
< CONFIG_NF_NAT=m
< CONFIG_NF_NAT_NEEDED=y
< CONFIG_IP_NF_TARGET_MASQUERADE=m
< # CONFIG_IP_NF_TARGET_REDIRECT is not set
< # CONFIG_IP_NF_TARGET_NETMAP is not set
< # CONFIG_NF_NAT_SNMP_BASIC is not set
< # CONFIG_NF_NAT_FTP is not set
< # CONFIG_NF_NAT_IRC is not set
< # CONFIG_NF_NAT_TFTP is not set
< # CONFIG_NF_NAT_AMANDA is not set
< # CONFIG_NF_NAT_PPTP is not set
< # CONFIG_NF_NAT_H323 is not set
< # CONFIG_NF_NAT_SIP is not set
The only that that worried me was the 'y' on ONFIG_NF_NAT_NEEDED=y as that could require changes in the kernel. However after a global search on the code, that flag does not affect the kernel just the nf_conntrack and related modules.
This leads me to two questions:
1) If I'm right that the kernel running on my box is different than what I'm able to build, where do I find the right kernel source? My uname returns:
Linux nas01 2.6.27.6.RNx86.2.1 #1 SMP Wed Apr 22 04:42:29 PDT 2009 i686 GNU/Linux
2) Assuming I can't get the "right" kernel source - how do I go about installing the newly built kernel?
I'd appreciate any help, thanks!
