How to create a static iptables executable

--

podman run -v /tmp:/tmp -it docker.io/gentoo/stage3:musl /bin/bashwget https://www.netfilter.org/projects/libnftnl/files/libnftnl-1.2.1.tar.bz2wget https://www.netfilter.org/projects/libmnl/files/libmnl-1.0.4.tar.bz2wget https://www.netfilter.org/projects/iptables/files/iptables-1.8.7.tar.bz2for f in $(ls *.tar.bz2); do tar -xvf $f; donecd libmnl-1.0.4
./configure --enable-static --disable-shared --prefix=/usr
make LDFLAGS="--static"
make install
cd ..
cd libnftnl-1.2.1
./configure --enable-static --disable-shared --prefix=/usr
make LDFLAGS="--static"
make install
cd ..
cd iptables-1.8.7
./configure --enable-static --disable-shared
make LDFLAGS="--static"
make install
cd ..
cp /usr/local/sbin/xtables* /tmp/

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Jakub Jóźwicki
Jakub Jóźwicki

No responses yet

Write a response