linux-2.6 and iptables compiled against 2.4 problems
Hello,
When I run iptables on a 2.6 kernel, I get an invalid argument with SNAT, and a target problem with REDIRECT.
The userspace tools are built against linux-2.4. When compiled against linux-2.6, it runs fine.
This happens with 1.2.8, and with cvs from 20030813 (i couldn't get 20030825 compiled).
I run this on a kernel from Mandrake, 2.4.22-1mdk or 2.6.-test3-1mdk.
The problem is that when a distribution like Mandrake ships both a 2.4 and a 2.6 kernel, it will have a broken iptables for linux-2.6. Linux-2.4 is still the main kernel, and that's the one which is used to compile iptables, while the latest 1.2.8 release doesn't compile against linux-2.6.
The workaround for this would be to have a seperate iptables package compiled from cvs against linux-2.6, but that's really no ideal situation.
I'm aware of the fact that linux-2.6 is ready yet for production, especially a firewall. But for people who want to for whatever reason, it would be good to have it working right. At the time that linux-2.6 is fully supported by distro's, together with linux-2.4, it's really needed to have this working right.
So I'm wondering if this incompatibility is (sort of) on purpose, or can I ask and expect a fix for it?
Just for information, these rules break for example:
# iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 127.0.0.1 iptables: Invalid argument # /sbin/iptables -t nat -I PREROUTING -i eth0 -p tcp --dport 53 -j REDIRECT # --to-ports 22 iptables: Target problem
--
Marcel Pol
Quoted 4 lines · Marcel Pol
The problem is that when a distribution like Mandrake ships both a 2.4 and a 2.6 kernel, it will have a broken iptables for linux-2.6. Linux-2.4 is still the main kernel, and that's the one which is used to compile iptables, while the latest 1.2.8 release doesn't compile against linux-2.6.
1.2.8 doesn't compile against 2.6 ? which 2.6 are you talking about? Why doesn't it compile? What error messages do you get?
In any case the solution would be to release a new iptables (1.2.9)
Quoted 1 line
Marcel Pol
Signature · 5 lines
- Harald Welte <[email protected]> http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie
Quoted 9 lines · On Fri, 5 Sep 2003 13:52:08 +0200 Harald Welte <[email protected]> wrote:
Quoted 5 lines · Marcel Pol
The problem is that when a distribution like Mandrake ships both a 2.4 and a 2.6 kernel, it will have a broken iptables for linux-2.6. Linux-2.4 is still the main kernel, and that's the one which is used to compile iptables, while the latest 1.2.8 release doesn't compile against linux-2.6.
1.2.8 doesn't compile against 2.6 ? which 2.6 are you talking about? Why doesn't it compile? What error messages do you get?
I'm compiling it against a 2.6-test4 kernelsource on mandrake cooker (9.2rc1) with gcc-3.3.1 and glibc-2-3-2.
cc -O2 -Wall -Wunused -I/usr/src/linux/include -Iinclude/ -DIPTABLES_VERSION=\"1.2.8\" -fPIC -o extensions/libipt_physdev_sh.o -c extensions/libipt_physdev.cextensions/libipt_physdev.c: In function `parse':extensions/libipt_physdev.c:86: error: `IPT_PHYSDEV_OP_MATCH_IN' undeclared (first use in this function)extensions/libipt_physdev.c:86: error: (Each undeclared identifier is reported only onceextensions/libipt_physdev.c:86: error: for each function it appears in.) extensions/libipt_physdev.c:97: error: `IPT_PHYSDEV_OP_MATCH_OUT' undeclared (first use in this function)extensions/libipt_physdev.c: In function `print':extensions/libipt_physdev.c:144: error: `IPT_PHYSDEV_OP_MATCH_IN' undeclared (first use in this function)extensions/libipt_physdev.c:146: error: `IPT_PHYSDEV_OP_MATCH_OUT' undeclared (first use in this function)extensions/libipt_physdev.c: In function `save':extensions/libipt_physdev.c:156: error: `IPT_PHYSDEV_OP_MATCH_IN' undeclared (first use in this function)extensions/libipt_physdev.c:158: error: `IPT_PHYSDEV_OP_MATCH_OUT' undeclared (first use in this function)
make: *** [extensions/libipt_physdev_sh.o] Error 1
Quoted 1 line
In any case the solution would be to release a new iptables (1.2.9)
If you do, would it be possible that if it's compiled against a 2.4 (2.4.22 or newer) kernel, that it still works on a 2.6 (test4 or newer) kernel? I think that's a bigger problem, because distro's will ship with two kernels, and having one iptables package that works on both would be a good thing. Having to ship two iptables packages will make it hard to get work right, and will be confusing for users.
--
Marcel Pol