API's for iptable commands

Thomas Haller thaller at redhat.com
Mon May 16 05:10:06 PDT 2016


On Sun, 2016-05-15 at 22:54 -0700, kadur.kiran at sawridgesystems.com
wrote:
> Hi All,
> 
> iptables -t mangle -I FORWARD 1 -o em1 -d 10.180.190.221 -p tcp --
> sport
> 22 -j MARK --set-mark 102
> 
> I want to reproduce above iptables command programatically using
> API's.
> But unable to find suitable documentation.
> please suggest is there any approach to achieve the same.
> 

Hi,

not netlink/libnl3.
https://stackoverflow.com/questions/109553/how-can-i-programmatically-manage-iptables-rules-on-the-fly

seems the ~best~ way is to run iptables binary.

best,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20160516/b8c540fd/attachment.sig>


More information about the libnl mailing list