SHOREWALL-NETMAP(5)
π SHOREWALL-NETMAP π
okay bestie, welcome to SHOREWALL-NETMAP(5) β a page from the Configuration Files chapter of the Shorewall manual, and honestly? it's giving address-remapping royalty. π
β¨ NAME β¨
netmap β the Shorewall NETMAP definition file. it's the file where you tell Shorewall how to map addresses from one network onto the corresponding addresses in another network. lowkey magical. π¦
πΈ SYNOPSIS πΈ
/etc/shorewall[6]/netmap
yes, that [6] means the IPv6 version lives right next door. she contains multitudes. π
π DESCRIPTION π
So this file is used to map addresses in one network to corresponding addresses in a second network. that's the whole vibe. β¨
β οΈ Warning, bestie, pay attention: to use this file, your kernel and iptables must have NETMAP support included. no NETMAP support, no NETMAP. periodt. π
The columns in the file are as follows β and where the column name is followed by a different name in parentheses, that different name is the one used in the alternate specification syntax. iykyk. π
π§ The Columns π§
TYPEβ {DNAT|SNAT}- If
DNAT, traffic enteringINTERFACEand addressed toNET1has its destination address rewritten to the corresponding address inNET2. - If
SNAT, traffic leavingINTERFACEwith a source address inNET1has it's source address rewritten to the corresponding address inNET2.
- If
NET1β network-address- Network in CIDR format (e.g.,
192.168.1.0/24). Beginning with Shorewall 4.4.24, exclusion[1] is supported. fancy. π
- Network in CIDR format (e.g.,
INTERFACEβ interface- The name of a network interface. The interface must be defined in shorewall-interfaces[2](5). Shorewall allows loose matches to wildcard entries in shorewall-interfaces[2](5). For example,
ppp0in this file will match a shorewall-interfaces[2](8) entry that definesppp+. yes, the+is doing a lot of work there and she's slaying. β¨
- The name of a network interface. The interface must be defined in shorewall-interfaces[2](5). Shorewall allows loose matches to wildcard entries in shorewall-interfaces[2](5). For example,
NET2β network-address- Network in CIDR format. that's it, that's the whole column. π
NET3(Optional) β network-address- Added in Shorewall 4.4.11. If specified, it qualifies
INTERFACE. It specifies a SOURCE network forDNATrules and a DESTINATION network forSNATrules. situational awareness, queen. π
- Added in Shorewall 4.4.11. If specified, it qualifies
PROTOβ protocol-number-or-name- Optional β added in Shorewall 4.4.23.2. Only packets specifying this protocol will have their IP header modified. picky in the best way. π
DPORTβ port-number-or-name-list- Optional β added in Shorewall 4.4.23.2. Destination Ports. A comma-separated list of Port names (from
services(5)), port numbers or port ranges; if the protocol isicmp, this column is interpreted as the destination icmp-type(s). ICMP types may be specified as a numeric type, a numeric type and code separated by a slash (e.g.,3/4), or a typename. Seehttps://shorewall.org/configuration_file_basics.htm#ICMP[3]. π - If the protocol is
ipp2p, this column is interpreted as an ipp2p option without the leading--(examplebitfor bit-torrent). If noPORTis given,ipp2pis assumed. - An entry in this field requires that the
PROTOcolumn specifyicmp(1),tcp(6),udp(17),sctp(132) orudplite(136). Use-if any of the following field is supplied. - This column was formerly labelled
DEST PORT(S).
- Optional β added in Shorewall 4.4.23.2. Destination Ports. A comma-separated list of Port names (from
SPORTβ port-number-or-name-list- Optional β added in Shorewall 4.4.23.2. Source port(s). If omitted, any source port is acceptable. Specified as a comma-separated list of port names, port numbers or port ranges. π
- An entry in this field requires that the
PROTOcolumn specifytcp(6),udp(17),sctp(132) orudplite(136). Use-if any of the following fields is supplied. - This column was formerly labelled
SOURCE PORT(S).
π FILES π
/etc/shorewall/netmap/etc/shorewall6/netmap
two files, one for each IP situation, both iconic. β¨
π₯ SEE ALSO π₯
https://shorewall.org/netmap.html[4]https://shorewall.org/configuration_file_basics.htm#Pairs[5]shorewall(8)
π NOTES π
- exclusion
https://shorewall.org/manpages/shorewall-exclusion.html - shorewall-interfaces
https://shorewall.org/manpages/shorewall-interfaces.html https://shorewall.org/configuration_file_basics.htm#ICMPhttps://shorewall.org/configuration_file_basics.htm#ICMPhttps://shorewall.org/netmap.htmlhttps://shorewall.org/netmap.htmlhttps://shorewall.org/configuration_file_basics.htm#Pairshttps://shorewall.org/configuration_file_basics.htm#Pairs
and that's the whole page, bestie!! π«Ά this one's filed under Configuration Files, dated 09/24/2020, and its manual name is SHOREWALL-NETMAP(5) β go map some addresses and be the main character of your own firewall. mwah. πβ¨
π¦ where this page comes from
- alpine 3.22: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- alpine 3.23: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- alpine 3.24: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- debian bookworm: shorewall 5.2.8-2 Β· GPL-2.0-or-later
- debian trixie: shorewall 5.2.8-6 Β· GPL-2.0-or-later
- fedora 43: shorewall 5.2.8-17.fc43 Β· GPL-2.0-or-later
- fedora 44: shorewall 5.2.8-18.fc44 Β· GPL-2.0-or-later
- nixos 26.05: shorewall 5.2.8
- nixpkgs unstable: shorewall 5.2.8
- ubuntu noble: shorewall 5.2.8-5 Β· GPL-2.0-or-later
- ubuntu questing: shorewall 5.2.8-6
- ubuntu resolute: shorewall 5.2.8-6build1 Β· GPL-2.0-or-later
- ubuntu stonking: shorewall 5.2.8-6build1 Β· 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