SHOREWALL-ADDRESSES(5)
β¨ shorewall-addresses(5) β¨
okay so bestie, this is section 5 of the manual β Configuration Files β and it's literally just the glow-up guide for how addresses work inside a Shorewall config. sit down, grab a snack π, we're doing this.
π NAME π
addresses β the way you write addresses inside a Shorewall configuration. that's it, that's the whole name, iconic.
πΈ DESCRIPTION πΈ
so in both Shorewall and Shorewall6, there are exactly two basic types of addresses, and you gotta know them both or nothing else makes sense:
- Host Address β this one is just one single host. one. solo. main character energy, no entourage.
- In IPv4, the format is
i.j.k.lwhereithroughlare decimal numbers between1and255. - In IPv6, the format is
a:b:c:d:e:f:g:hwhereathroughhconsist of1to4hexadecimal digits (leading zeros may be omitted). a single series of0addresses may be omitted. for example2001:227:e857:1:0:0:0:0:1may be written2001:227:e857:1::1. the abbreviation ate, no crumbs π
- In IPv4, the format is
- Network Address β this one refers to 1 or more hosts, and it's built like a host address followed by a slash (
"/") and a Variable Length Subnet Mask (VLSM). this is what the girlies call Classless Internet Domain Routing (CIDR) notation. yes the acronym stacks are a lot, we move.- The VLSM is a decimal number. For IPv4, it's in the range
0through32. For IPv6, the range is0through128. that number = how many leading bits of the address represent the network address; the rest of the bits are a host address and are generally given as zero. - Examples, because we love a demo:
- The VLSM is a decimal number. For IPv4, it's in the range
IPv4: 192.168.1.0/24
IPv6: 2001:227:e857:1:0:0:0:0:1/64
In the Shorewall documentation and manpages, they've tried to make it clear which type of address is accepted in each specific case. respect for the transparency honestly π«Ά
β οΈ important vibe check: because Shorewall uses a colon (":") as a separator in many contexts, IPv6 addresses are best written using the standard convention where the address itself is enclosed in square brackets:
[2001:227:e857:1::1]
[2001:227:e857:1::]/64
π¦ SPECIFYING SOURCE AND DEST π¦
Entries in Shorewall configuration files often deal with the source (SOURCE) and destination (DEST) of connections, and Shorewall implements a uniform way for specifying them. one format to rule them all, slay.
A SOURCE or DEST consists of one to three parts separated by colons (":"):
- ZONE β the name of a zone declared in
/etc/shorewall/zonesor/etc/shorewall6/zones. this part is only available in the rules file (/etc/shorewall/rules,/etc/shorewall/blrules,/etc/shorewall6/rulesand/etc/shorewall6/blrules). - INTERFACE β the name of an interface that matches an entry in
/etc/shorewall/interfaces(/etc/shorewall6/interfaces).- Beginning with Shorweall
5.2.1, the interface may be preceded with'!'which matches all interfaces except the one specified. not me excluding people from the party π
- Beginning with Shorweall
- ADDRESS LIST β a list of one or more addresses (host or network) or address ranges, separated by commas. in an IPv6 configuration, this list must be included in square or angled brackets (
"[...]"or"<...>"). the list may have exclusion.
β Examples β
- All hosts in the
netzone βnet - Subnet
192.168.1.0/29in theloczone βloc:192.168.1.0/29 - All hosts in the
netzone connecting throughppp0βnet:ppp0 - All hosts interfaced by
eth3βeth3 - Subnet
10.0.1.0/24interfacing througheth2βeth2:10.0.1.0/24 - Host
2002:ce7c:92b4:1:a00:27ff:feb1:46a9in theloczone βloc:[2002:ce7c:92b4:1:a00:27ff:feb1:46a9] - The primary IP address of
eth0in the$FWzone -$FW:ð0 - All hosts in Vatican City -
net:^VA(Requires the GeoIP Match capability).
π₯ IP ADDRESS RANGES π₯
If you kernel and iptables have IP Range match support, you may use IP address ranges in Shorewall configuration file entries; IP address ranges have the syntax <low IP address>-<high IP address>.
Example: 192.168.1.5-192.168.1.12.
π SEE ALSO π
For more information about addressing, see the Setup Guide[1].
π NOTES π
and that's the whole thing bestie, you're officially an addressing expert, no cap π this was Configuration Files, dated 09/24/2020, and you just read SHOREWALL-ADDRESSES(5) β go forth and subnet responsibly πβ¨π¦
π¦ 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