All of lore.kernel.org
 help / color / mirror / Atom feed
* how to do port forwarding using nftables map
@ 2015-09-21  2:09 神楽坂玲奈
  2015-09-21  8:49 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 5+ messages in thread
From: 神楽坂玲奈 @ 2015-09-21  2:09 UTC (permalink / raw)
  To: netfilter

I'm doing many port forwarding service on a linux server. There will
be many(may thousands of) port forward rule so I want to use nftables
map to improve performance rather than just many rules.

the policy will be [protocol : port -> address : port], like [tcp 1234
-> 1.1.1.1:4321], forward tcp 1234 port to address 1.1.1.1 same
protocol port 4321.
the protocol may only tcp and udp. so it's also ok if the key can
support only one port field. i can set maps and rules for each
protocol.

the problem is, how to define the value "ip:port" using map?

I tried create 2 maps, using

> nft add map nat forward_address {type inet_service : ipv4_addr \;}
> nft add map nat forward_port {type inet_service : inet_service \;}

but then I don't know how to set dnat rule....... seems the dnat
destnation can only accept one map value? and also i don't know how to
set "ip:port" as one value in map.

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

end of thread, other threads:[~2015-09-22  2:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21  2:09 how to do port forwarding using nftables map 神楽坂玲奈
2015-09-21  8:49 ` Pablo Neira Ayuso
2015-09-21 15:30   ` 神楽坂玲奈
2015-09-21 20:03     ` Pablo Neira Ayuso
2015-09-22  2:21       ` 神楽坂玲奈

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.