Skip to contentSkip to conversation

iptables - Couldn't load target error

DISCUSSION Saravanan Chanemouganandam 4 participants 6 messages Dec 19, 2007 – Dec 20, 2007

lore
Share & tools
lore
#0 lore raw

Hi all,

I have some problem with iptables (v1.3.8) and extension supports libraries installed to the buildroot's root filesystem (/lib/iptables) running on Xscale pxa270.

iptables with MASQUERADE support throws Couldn't load target error. The following strace shows that it tries to open libraries in the /lib and in the /usr/lib instead of /lib/iptables.

Can anybody precise me, why it is not looking into /lib/iptables for the dynamic libraries?

#strace iptables -t nat -A POSTROUTING -o br_wan -j MASQUERADE shows
....

open("/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib/iptables/libipt_MASQUERADE.so",) open("/lib/libipt_MASQUERADE.so", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/lib/libipt_MASQUERADE.so", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/usr/lib/libipt_MASQUERADE.so", O_RDONLY) = -1 ENOENT (No such file or directory)
munmap(0x40006000, 698) = 0
write(2, "iptables", 8iptables) = 8
write(2, " v", 2 v) = 2
write(2, "1.3.8", 51.3.8) = 5
write(2, ": ", 2: ) = 2
write(2, "Couldn\'t load target ", 22Couldn't load target ) = 22
write(2, "MASQUERADE", 10MASQUERADE) = 10
write(2, "\':", 2':) = 2
write(2, "File not found", 14File not found) = 14

thanks
Sara

#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Saravanan Chanemouganandam

iptables with MASQUERADE support throws Couldn't load target error. The following strace shows that it tries to open libraries in the /lib and in the /usr/lib instead of /lib/iptables.

Maybe because your LD_LIBRARY_PATH needs to be adapted accordingly?

man ldconfig

ciao,
- --
Alexander Griesser (Netzwerkadministration)
E-Mail: [email protected] | Web: http://www.lkh-vil.or.at
KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach
Tel.: +43 4242 208 3061 | Fax.: +43 4242 971 3061
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHaQcJ66HVD6KUm1oRAvm8AJ44DrrsphkQ13OGAxB7xKK1Ma8GFQCfatGA 0jeJVKaO0JcQrW5CTlWReaU=
=PlTs
-----END PGP SIGNATURE-----

#2 lore raw
In reply to Saravanan Chanemouganandam
Quoted 3 lines · Saravanan Chanemouganandam

I have some problem with iptables (v1.3.8) and extension supports libraries installed to the buildroot's root filesystem (/lib/iptables) running on Xscale pxa270.

this isnt a busybox issue. please dont mass cc us next time.

Quoted 3 lines

iptables with MASQUERADE support throws Couldn't load target error. The following strace shows that it tries to open libraries in the /lib and in the /usr/lib instead of /lib/iptables.

your iptables was compiled incorrectly. the library path is irrelevant as the iptables compile should select the runtime path correctly. complain to whoever build your iptables.

you can clearly see it here:

Quoted 2 lines

open("/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib/ipta bles/libipt_MASQUERADE.so",)

guess you should complain to the buildroot list
-mike

#3 lore raw
In reply to Saravanan Chanemouganandam
Quoted 9 lines · Saravanan Chanemouganandam

Hi all,

I have some problem with iptables (v1.3.8) and extension supports libraries installed to the buildroot's root filesystem (/lib/iptables) running on Xscale pxa270.

iptables with MASQUERADE support throws Couldn't load target error. The following strace shows that it tries to open libraries in the /lib and in the /usr/lib instead of /lib/iptables.

Last time I built iptables from source it was iptables-1.3.5. iptables are not using de-facto standard "configure+make" install process, they take make variables instead.

Mine was built with:

# Do NOT point it to non-pristine kernel tree!
# (seen horrible miscompilation on 32:64 user:kernel x86_64) KERNEL_DIR=/usr/src/kernel/delay/linux-2.6.17.11.src

make KERNEL_DIR="$KERNEL_DIR" BINDIR=... LIBDIR=... MANDIR=...

I guess you built your iptables with wrong/unset LIBDIR.

People were right pointing out that this is not busybox related question. --
vda

#4 lore raw

Hi vda,

I accept your comment and others that it was not a busybox related issue.

Well, here is my situation.I built a small rootfs for my arm pxa270 target board on the host x86 machine using the latest Buildroot. I then downloaded & installed iptables(v1.3.8) using

make KERNEL_DIR=/home/sara/cm-x270/linux-2.6.16 CC=/home/sara/BuildRoot/buildroot/build_arm/staging_dir/usr/bin/arm-linux-gcc LD=/home/sara/BuildRoot/buildroot/build_arm/staging_dir/usr/bin/arm-linux-ld BINDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/sbin LIBDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib

make BINDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/sbin LIBDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib install

command install all iptables into the rootfs under "/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root" with all iptables and extension supports are built into linux kernel "/home/sara/cm-x270/linux-2.6.16" image.

I then boot my cm-x270 target board using setboot os "console=ttySA0,38400 root=/dev/nfs nfsroot=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root ip=::::cm-x270:eth0".

Now, when I perform MASQUERADE , it couldn't find libipt_MASQUERADE.so but it is installed in /lib/iptables.

sara:/$ ldconfig -v show /lib , /usr/lib. 
ldconfig: uClibc version
/lib:
        libc.so.0 => libuClibc-0.9.29.so
        libnsl.so.0 => libnsl-0.9.29.so
        libdl.so.0 => libdl-0.9.29.so
        librt.so.0 => librt-0.9.29.so
        libgcc_s.so.1 => libgcc_s.so.1
        libncurses.so.5 => libncurses.so.5.6
        libutil.so.0 => libutil-0.9.29.so
        libcrypt.so.0 => libcrypt-0.9.29.so
        ld-uClibc.so.0 => ld-uClibc-0.9.29.so
        libpthread.so.0 => libpthread-0.9.29.so
        libresolv.so.0 => libresolv-0.9.29.so
        libm.so.0 => libm-0.9.29.so
/usr/lib:
        libstdc++.so.6 => libstdc++.so.6.0.8
        libz.so.1 => libz.so.1.2.3

/lib/iptables is not visible in the system to load the library.

thanks
Sara

Le Jeudi 20 Décembre 2007 11:03, Denys Vlasenko a écrit :

Quoted 28 lines · Saravanan Chanemouganandam
Quoted 9 lines

Hi all,

I have some problem with iptables (v1.3.8) and extension supports libraries installed to the buildroot's root filesystem (/lib/iptables) running on Xscale pxa270.

iptables with MASQUERADE support throws Couldn't load target error. The following strace shows that it tries to open libraries in the /lib and in the /usr/lib instead of /lib/iptables.

Last time I built iptables from source it was iptables-1.3.5. iptables are not using de-facto standard "configure+make" install process, they take make variables instead.

Mine was built with:

# Do NOT point it to non-pristine kernel tree!
# (seen horrible miscompilation on 32:64 user:kernel x86_64) KERNEL_DIR=/usr/src/kernel/delay/linux-2.6.17.11.src

make KERNEL_DIR="$KERNEL_DIR" BINDIR=... LIBDIR=... MANDIR=...

I guess you built your iptables with wrong/unset LIBDIR.

People were right pointing out that this is not busybox related question. --
vda

#5 lore raw
Quoted 20 lines · Saravanan Chanemouganandam

Hi vda,

I accept your comment and others that it was not a busybox related issue.

Well, here is my situation.I built a small rootfs for my arm pxa270 target board on the host x86 machine using the latest Buildroot. I then downloaded & installed iptables(v1.3.8) using

make KERNEL_DIR=/home/sara/cm-x270/linux-2.6.16 CC=/home/sara/BuildRoot/buildroot/build_arm/staging_dir/usr/bin/arm-linux-g cc LD=/home/sara/BuildRoot/buildroot/build_arm/staging_dir/usr/bin/arm-linux-l d BINDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/sbin LIBDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib

make BINDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/sbin LIBDIR=/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root/lib install

Quoted 4 lines

command install all iptables into the rootfs under "/home/sara/BuildRoot/buildroot/project_build_arm/uclibc/root" with all iptables and extension supports are built into linux kernel "/home/sara/cm-x270/linux-2.6.16" image.

Yes, but iptable developers meant that option to indicate _where to find_ modules at runtime!

You need to have different LIBDIR= settings for "make" and "make install".

make LIBDIR=/where/to/look/for/modules/at/runtime
make LIBDIR=/where/to/install/modules install

If it will not work (say, make install will start rebuilding stuff due to changed LIBDIR), you will need to do "make install" - by hand copying stuff. Feel free to curse a lot in the process.

--
vda