firehol-masquerade(5)
π firehol-masquerade β bestie's guide to NAT-ing on an interface
okay so this is firehol-masquerade(5) from the FireHOL Reference, version 3.1.8, and it's literally the page that teaches you how to set up masquerading (NAT) on an interface. sit down, grab a snack π, we're doing networking.
β¨ SYNOPSIS β¨
masquerade real-interface rule-params
masquerade [reverse] rule-params
that's it. that's the whole vibe. two forms, no cap. π
π¦ DESCRIPTION π¦
the masquerade helper command sets up masquerading on the output of a real network interface β as opposed to a FireHOL interface definition. yes bestie, that distinction matters, i promise.
if a real-interface is specified, the command should be used before any interface or router definitions. multiple values can be given separated by whitespace, so long as they are enclosed in quotes. π
if used within an interface definition, the definition's real-interface will be used.
if used within a router definition, the definition's outface(s) will be used, if specified. and if the reverse option is given, then the definition's inface(s) will be used, if specified. π
not me about to drop the most important plot twist: unlike most commands,masqueradedoes not inherit its parent definition'srule-params. it only honours its own. theinfaceandoutfaceparameters should not be used βiptables(8)does not supportinfacein thePOSTROUTINGchain, andoutfacewill be overwritten by FireHOL using the rules above. so likeβ¦ don't. π
Note π themasqueradealways applies to the output of the chosen network interfaces.FIREHOL_NATwill be turned on automatically (seefirehol-defaults.conf(5)) and FireHOL will enable packet-forwarding in the kernel.
π MASQUERADING AND SNAT π
masquerading is a special form of Source NAT (SNAT) that changes the source of requests when they go out, and replaces their original source when they come in. the way that it justβ¦ does that. πβ¨
this way a Linux host can become an Internet router for a LAN of clients having unroutable IP addresses. masquerading takes care to re-map IP addresses and ports as required.
now the part nobody wants to hear: masquerading is expensive compared to SNAT because it checks the IP address of the outgoing interface every time for every packet. π if your host has a static IP address you should generally prefer SNAT.
π EXAMPLES π
# Before any interface or router
masquerade eth0 src 192.0.2.0/24 dst not 192.0.2.0/24
# In an interface definition to masquerade the output of its real-interface
masquerade
# In a router definition to masquerade the output of its outface
masquerade
# In a router definition to masquerade the output of its inface
masquerade reverse
iconic. ate. no notes. π₯
π SEE ALSO π
firehol(1)β FireHOL programfirehol.conf(5)β FireHOL configurationfirehol-interface(5)β interface definitionfirehol-router(5)β router definitionfirehol-params(5)β optional rule parametersfirehol-nat(5)βnat,snat,dnat,redirectconfig helpers- FireHOL Website
- FireHOL Online PDF Manual
- FireHOL Online Documentation
π AUTHORS π
FireHOL Team. (periodt, they did that π«Ά)
FireHOL Reference β¦ version 3.1.8 β¦ built 13 Apr 2025 β that's the whole firehol-masquerade(5) moment, bestie. go forth and NAT responsibly, mwah π
ππΈ
π¦ where this page comes from
- debian trixie: firehol-doc 3.1.8+ds-1 Β· GPL-2.0-or-later
- ubuntu resolute: firehol-doc 3.1.8+ds-1 Β· GPL-2.0-or-later
- ubuntu stonking: firehol-doc 3.1.8+ds-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms