SHOREWALL-ARPRULES(5)

πŸ“¦
version 5.2.8 Β· 2 versions
  • 5.2.8 Β· alpine 3.22, alpine 3.23, alpine 3.24, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 5.2.3.4 Β· ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ¦‹ SHOREWALL-ARPRULES(5) πŸ¦‹

okay bestie, so this is the manual page for arprules(5), straight out of the Configuration Files section of the Shorewall docs. Buckle up, we're going low-level πŸ’…


✨ NAME ✨

arprules β€” the Shorewall ARP rules file πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

/etc/shorewall/arprules

πŸ’œ DESCRIPTION πŸ’œ

IPv4 only, bestie. That's the vibe check and it passed.

This file showed up in Shorewall 4.5.12 and its whole thing is describing the low-level rules that get managed by arptables(8). These rules only touch Address Resolution Protocol (ARP), Reverse Address Resolution Protocol (RARP) and Dynamic Reverse Address Resolution Protocol (DRARP) frames. That's it. That's the lane they stay in. πŸ¦‹

The columns in the file are the ones below, and jsyk MAC addresses are specified normally β€” meaning six hexadecimal numbers separated by colons. No cap. ✨

πŸ‘‘ ACTION

Describes the action to take when a frame matches the criteria in the other columns. Possible values are:

  • ACCEPT β€” the default action when no rules match a frame; it lets the frame go through. 🫢
  • DROP β€” causes the frame to be dropped. bye πŸ’€
  • SNAT:ip-address β€” modifies the source IP address to the specified ip-address.
  • DNAT:ip-address β€” modifies the destination IP address to the specified ip-address.
  • SMAT:mac-address β€” modifies the source MAC address to the specified mac-address.
  • DMAT:mac-address β€” modifies the destination MAC address to the specified mac-address.
  • SNATC:ip-address β€” like SNAT except that the frame is then passed to the next rule. ✨
  • DNATC:ip-address β€” like DNAT except that the frame is then passed to the next rule. ✨
  • SMATC:mac-address β€” like SMAT except that the frame is then passed to the next rule. ✨
  • DMATC:mac-address β€” like DMAT except that the frame is then passed to the next rule. ✨

🧚 SOURCE

Format:

[interface[:[!]ipaddress[/ipmask][:[!]macaddress[/macmask]]]]

Where:

  • interface β€” is an interface defined in shorewall-interfaces(5). πŸŽ€
  • ipaddress β€” is an IPv4 address. DNS names are not allowed.
  • ipmask β€” specifies a mask to be applied to ipaddress.
  • macaddress β€” the source MAC address.
  • macmask β€” mask for MAC address; must be specified as six hexadecimal numbers separated by colons.

When ! is specified, the test is inverted. πŸ™ƒ

If not specified, matches only frames originating on the firewall itself.

⚠️ Caution: either SOURCE or DEST must be specified. Like, fr fr, one of them. You cannot skip both. 😭

🌈 DEST

Format:

[interface[:[!]ipaddress[/ipmask][:[!]macaddress[/macmask]]]]

Where:

  • interface β€” is an interface defined in shorewall-interfaces(5). πŸŽ€
  • ipaddress β€” is an IPv4 address. DNS Names are not allowed.
  • ipmask β€” specifies a mask to be applied to frame addresses.
  • macaddress β€” the destination MAC address.
  • macmask β€” mask for MAC address; must be specified as six hexadecimal numbers separated by colons.

When ! is specified, the test is inverted and the rule matches frames which do not match the specified address/mask.

If not specified, matches only frames originating on the firewall itself.

If both SOURCE and DEST are specified, then both interfaces must be bridge ports on the same bridge. no mixing bridges, bestie πŸ’…

⚠️ Caution: either SOURCE or DEST must be specified. yes again. it's that important. πŸ™ˆ

πŸ“ OPCODE

Format:

[[!]opcode]

Optional. Describes the type of frame. Possible opcode values are:

  1. 1 β€” ARP Request
  2. 2 β€” ARP Reply
  3. 3 β€” RARP Request
  4. 4 β€” RARP Reply
  5. 5 β€” Dynamic RARP Request
  6. 6 β€” Dynamic RARP Reply
  7. 7 β€” Dynamic RARP Error
  8. 8 β€” InARP Request
  9. 9 β€” ARP NAK

When ! is specified, the test is inverted and the rule matches frames which do not match the specified opcode. πŸ™ƒ


🌸 EXAMPLE 🌸

The eth1 interface has both a public IP address and a private address (10.1.10.11/24). When sending ARP requests to 10.1.10.0/24, use the private address as the IP source:

#ACTION                SOURCE                  DEST                ARP OPCODE
SNAT:10.1.10.11        -                       eth1:10.1.10.0/24   1

iconic. she ate. πŸ”₯


πŸŽ€ FILES πŸŽ€

/etc/shorewall/arprules

πŸ’– SEE ALSO πŸ’–


Configuration Files Β· 09/24/2020

and that's the whole page bestie 🫢 this came from the Configuration Files part of the Shorewall manual and it was dated 09/24/2020 β€” go forth and ARP responsibly, mwah πŸ’‹βœ¨