I am writing an application using libc, for that am in search of an api for iptables so that i can add firewall rules using my program .is there any available set of api to do this.
Asked
Active
Viewed 9,678 times
1 Answers
5
You can use libiptc
Quote from the howto page:
libiptc is the library that is used to communicate with netfilter, the internal kernel code in charge of firewalling and packet filtering. This code and iptables were written by Paul "Rusty" Russell. iptables was developed using libiptc calls to get the job done.

Eloims
- 5,106
- 4
- 25
- 41
-
1See also http://www.bani.com.br/lang/en/2012/05/programmatically-managing-iptables-rules-in-c-iptc/ – mpontillo Apr 12 '13 at 17:07
-
`libiptc` seems to be pretty outdated with latest release 20 years ago. – AleXoundOS Feb 25 '22 at 19:14