/iptables-cpp

C++ library for programmatically managing iptables rules. Supports listing, adding, modifying, and deleting iptable rules.

Primary LanguageC++MIT LicenseMIT

iptables-cpp

CircleCI CodeFactor codecov

C++ library for listing, adding, modifying, and deleting iptable rules

Build instructions

Using a docker container

Building the docker image:

git clone https://github.com/thomastli/iptables-cpp.git \
cd iptables-cpp \
docker build -t iptables-ubuntu . \

Running the docker image in a container:

docker run -it --cap-add=NET_ADMIN --cap-add=NET_RAW iptables-ubuntu /bin/bash \
git clone https://github.com/thomastli/iptables-cpp.git \
cd iptables-cpp \
sudo ./build.sh

Local builds

Building iptables-cpp using the build script:

git clone https://github.com/thomastli/iptables-cpp.git \
cd iptables-cpp \
sudo ./build.sh

Usage instructions

Running the demo:

sudo ./iptablescpp

Running the unit tests:

sudo ./iptablescpp_test