<feed xmlns='http://www.w3.org/2005/Atom'>
<title>firewall4/tests/03_rules/21_mac_ranges, branch master</title>
<subtitle>OpenWrt nftables firewall</subtitle>
<id>https://git.openwrt.org/project/firewall4/atom?h=master</id>
<link rel='self' href='https://git.openwrt.org/project/firewall4/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/'/>
<updated>2026-11-02T23:15:59Z</updated>
<entry>
<title>firewall4: enable mac ranges for rule</title>
<updated>2026-11-02T23:15:59Z</updated>
<author>
<name>Christian Korber</name>
</author>
<published>2025-10-02T10:16:15Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=ba2ae80a48c6287abea6da954c6cec10f58bfff4'/>
<id>urn:sha1:ba2ae80a48c6287abea6da954c6cec10f58bfff4</id>
<content type='text'>
nft supports handling mac ranges and therefore this commit changes fw4
to support that feature. The src_mac is now allowed to be a range of two
addresses. If no range is given, the old logic is applied.

So this is now possible:
```
option src_mac '00:11:AA:00:00:00-00:11:AA:FF:FF:FF'
```
In addition to the original:
```
option src_mac '00:11:AA:00:00:00'
```

This is done by changing the regex to parse for an additional MAC address
if '-' is matched after the first MAC address.

Negative matching using exclamation mark is supported.

Signed-off-by: Christian Korber &lt;ck@dev.tdt.de&gt;
[folded fix: reject malformed MAC ranges without a dash and add test coverage]
Signed-off-by: Jo-Philipp Wich &lt;jo@mein.io&gt;
</content>
</entry>
</feed>
