Last active
November 3, 2024 19:59
-
-
Save prologic/d84634f3c49f6bde4d73 to your computer and use it in GitHub Desktop.
iptables built as a static standalone binary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name=iptables | |
version=1.4.21 | |
release=1 | |
source=(ftp://ftp.netfilter.org/pub/iptables/$name-$version.tar.bz2) | |
PKG="$(pwd)/pkg" | |
if [ -d $PKG ]; then | |
mkdir -p $PKG | |
fi | |
if [ ! -d $name-$version ]; then | |
curl -q -L -O $source | |
tar xvf $name-$version.*tar* | |
fi | |
cd $name-$version | |
./configure \ | |
--prefix=/usr \ | |
--mandir=/usr/man \ | |
--disable-shared \ | |
--enable-static | |
export CFLAGS='-static' | |
export LDFLAGS='-static -dl' | |
make | |
make DESTDIR=$PKG install | |
ldd $PKG/usr/sbin/xtables-multi |
THe last step in the above script produces:
linux-vdso.so.1 (0x00007fffaefdf000) libm.so.6 => /lib/libm.so.6 (0x00007f3f7006b000) libc.so.6 => /lib/libc.so.6 (0x00007f3f6fcc4000) /lib/ld-linux-x86-64.so.2 (0x00007f3f7036c000)
How can we build iptables statically?
try make LDFLAGS='-all-static'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
THe last step in the above script produces:
How can we build iptables statically?