]> git.ipfire.org Git - thirdparty/iptables.git/commit
extensions: libip6t_SNAT: Add translation to nft
authorShivani Bhardwaj <shivanib134@gmail.com>
Wed, 30 Dec 2015 09:24:57 +0000 (14:54 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 16 Feb 2016 18:30:24 +0000 (19:30 +0100)
commitd4721236c2e8808958ada3d7b2548f4c473908a0
tree5a1e3d648532755da2634cbace46ae8b93e1ccc0
parentce14561a0b005b7a7993bf0113cdf5dd8b1b53ca
extensions: libip6t_SNAT: Add translation to nft

Add translation for SNAT target to nftables.

Examples:

$ sudo ip6tables-translate -t nat -A postrouting -o eth0 -p tcp -j SNAT --to [fec0::1234]:80
nft add rule ip6 nat postrouting oifname eth0 ip6 nexthdr tcp counter snat fec0::1234 :80

$ sudo ip6tables-translate -t nat -A postrouting -o eth0 -p tcp -j SNAT --to [fec0::1234]:1-20
nft add rule ip6 nat postrouting oifname eth0 ip6 nexthdr tcp counter snat fec0::1234 :1-20

$ sudo ip6tables-translate -t nat -A postrouting -o eth0 -p tcp -j SNAT --to [fec0::1234]:123 --random
nft add rule ip6 nat postrouting oifname eth0 ip6 nexthdr tcp counter snat fec0::1234 :123 random

$ sudo ip6tables-translate -t nat -A postrouting -o eth0 -p tcp -j SNAT --to [fec0::1234]:123 --random-fully --persistent
nft add rule ip6 nat postrouting oifname eth0 ip6 nexthdr tcp counter snat fec0::1234 :123 fully-random,persistent

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
extensions/libip6t_SNAT.c