Skip to contentSkip to conversation

Question about "masquerade"

DISCUSSION Kamil Jońca 3 participants 3 messages May 9, 2022 – May 10, 2022

lore
Share & tools
lore
#0 lore raw

Maybe I miss something obvious in documentation. How stable is "masquerade"
I know that it translates addresses.
But what about ports? Changes them somehow? Keepos original? KJ

Signature · 1 line
http://wolnelektury.pl/wesprzyj/teraz/
#1 lore raw
Quoted 5 lines · Kamil Jońca

Maybe I miss something obvious in documentation. How stable is "masquerade"
I know that it translates addresses.
But what about ports? Changes them somehow? Keepos original?

Depends. Default behaviour is to change the port if keeping it the same would result in a conflicting mapping.

See MASQUERADE --random in iptables-extensions man page or random flag in nft man page.

#2 lore raw
In reply to Kamil Jońca

Hi Kamil,

From the nftwiki docs: "Masquerade is a special case of SNAT, where the source address is automagically set to the address of the output interface", so it's just like SNAT without specifying the source address which then gets assigned dynamically depending on the output interface. You con also configure the port with "masquerade to :1024"

Quoted 10 lines · Kamil Jońca

Maybe I miss something obvious in documentation. How stable is "masquerade"
I know that it translates addresses.
But what about ports? Changes them somehow? Keepos original? KJ

--
http://wolnelektury.pl/wesprzyj/teraz/

Signature · 5 lines
Maximiliano Estudies
VDT Referat Beschallung
+49 176 36784771
omslo.com
maxiestudies.com