I need to add an iptables rule from the inside of a C Linux program.
How should I do? Do I need root privilege or can I just grant some capabilities?
I tried granting CAP_NET_RAW+iep and using popen(), system() and execve() to set iptables but it doesn't work.
It obviously works when I sudo but I would like not to grant root privilege.