* Nftables src NAT with port range allocation
@ 2020-08-27 22:57 Joshua Moore
0 siblings, 0 replies; 3+ messages in thread
From: Joshua Moore @ 2020-08-27 22:57 UTC (permalink / raw)
To: netfilter
Hello,
I am wanting to do a determinate src NAT IP/port range allocation
leveraging nftables. For example, for every "original src
address:original src port" there is a mapped "new src address:new src
port". The original source address is known but the original source
port is unknown. The new src address is known and the new src port is
from a known range or ports.
I thought about leveraging maps to do this but I'm unsure of the best
way to dynamically capture the unknown src address. Any suggestions?
Thanks!
--
Joshua Moore
^ permalink raw reply [flat|nested] 3+ messages in thread
* Nftables src NAT with port range allocation
@ 2020-08-27 23:02 Joshua Moore
2020-08-31 15:36 ` Pablo Neira Ayuso
0 siblings, 1 reply; 3+ messages in thread
From: Joshua Moore @ 2020-08-27 23:02 UTC (permalink / raw)
To: netfilter
Hello,
I am wanting to do a determinate src NAT IP/port range allocation
leveraging nftables. For example, for every "original src
address:original src port" there is a mapped "new src address:new src
port". The original source address is known but the original source
port is unknown. The new src address is known and the new src port is
from a known range or ports.
I thought about leveraging maps to do this but I'm unsure of the best
way to dynamically capture the unknown src address. Any suggestions?
Thanks!
--
Joshua Moore
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Nftables src NAT with port range allocation
2020-08-27 23:02 Nftables src NAT with port range allocation Joshua Moore
@ 2020-08-31 15:36 ` Pablo Neira Ayuso
0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2020-08-31 15:36 UTC (permalink / raw)
To: Joshua Moore; +Cc: netfilter
On Thu, Aug 27, 2020 at 06:02:58PM -0500, Joshua Moore wrote:
> Hello,
>
> I am wanting to do a determinate src NAT IP/port range allocation
> leveraging nftables. For example, for every "original src
> address:original src port" there is a mapped "new src address:new src
> port". The original source address is known but the original source
> port is unknown. The new src address is known and the new src port is
> from a known range or ports.
>
> I thought about leveraging maps to do this but I'm unsure of the best
> way to dynamically capture the unknown src address. Any suggestions?
table ip nat {
chain prerouting {
type nat hook prerouting priority dstnat; policy accept;
dnat ip addr . port to ip saddr . th dport map { 2.2.2.2 . 80 : 3.3.3.3 . 443 }
}
}
This is mapping:
IP saddr th dport IP daddr dport
2.2.2.2 . 80 -> 3.3.3.3 443
IIRC, this is available since nft 0.9.4, I'm testing with current git
snapshot.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-31 15:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-27 23:02 Nftables src NAT with port range allocation Joshua Moore
2020-08-31 15:36 ` Pablo Neira Ayuso
-- strict thread matches above, loose matches on Subject: below --
2020-08-27 22:57 Joshua Moore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox