All of lore.kernel.org
 help / color / mirror / Atom feed
* IPSET: programmatically implementing ip6tables snat rule including ipset matching
@ 2016-09-21 16:11 Khawar
  2016-09-22  9:36 ` Jozsef Kadlecsik
  0 siblings, 1 reply; 2+ messages in thread
From: Khawar @ 2016-09-21 16:11 UTC (permalink / raw)
  To: netfilter

It is a newbie question, so I would highly appreciate your time.

You can also view my question here 
http://unix.stackexchange.com/questions/311373/how-to-programmatically-implement-ip6tables-rule-including-ipset

I want to implement following using C programming

     "ip6tables -t nat -j postrouting -d 
<ipv6-address-in-destination-field> -m set --match-set xyz -j snat 
--to-source <ipv6-address>"

What should I take into account?
I have already installed the ipset userspace and kernel modules. I can 
easily use ipset specific socket options etc which mean my compilation 
and installation is somewhat ok.

Thanks



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: IPSET: programmatically implementing ip6tables snat rule including ipset matching
  2016-09-21 16:11 IPSET: programmatically implementing ip6tables snat rule including ipset matching Khawar
@ 2016-09-22  9:36 ` Jozsef Kadlecsik
  0 siblings, 0 replies; 2+ messages in thread
From: Jozsef Kadlecsik @ 2016-09-22  9:36 UTC (permalink / raw)
  To: Khawar; +Cc: netfilter

On Wed, 21 Sep 2016, Khawar wrote:

> I want to implement following using C programming
> 
>     "ip6tables -t nat -j postrouting -d <ipv6-address-in-destination-field> -m
> set --match-set xyz -j snat --to-source <ipv6-address>"

I assumne by "implement following using C programming" you mean to call 
exec() from your code. If not, the stop in your project and rethink: 
libiptables from the iptables package was never meant to be used by third 
party projects, check out nftables.

> What should I take into account?

There's nothing fancy there:

- create the sets before you refer them in i[6]ptables rules
- use proper syntax (the flag parameter is missing from the set match)

> I have already installed the ipset userspace and kernel modules. I can 
> easily use ipset specific socket options etc which mean my compilation 
> and installation is somewhat ok.

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-22  9:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21 16:11 IPSET: programmatically implementing ip6tables snat rule including ipset matching Khawar
2016-09-22  9:36 ` Jozsef Kadlecsik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.