Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mDNS Repeater plugin: Enable blocklist parameter in the gui to allow blocking subnets. #4362

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion net/mdns-repeater/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PLUGIN_NAME= mdns-repeater
PLUGIN_VERSION= 1.1
PLUGIN_VERSION= 1.2
PLUGIN_REVISION= 1
PLUGIN_COMMENT= Proxy multicast DNS between networks
PLUGIN_MAINTAINER= [email protected]
Expand Down
5 changes: 5 additions & 0 deletions net/mdns-repeater/pkg-descr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ It can be used to bridge zeroconf devices to work properly across the two subnet
Plugin Changelog
================

1.2

* Blocklist support (contributed by Kodehyrden)


1.1

* CARP support (contributed by Markus Reiter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@
<type>select_multiple</type>
<help>At least 2 interfaces must be selected. The maximum number of supported interfaces by the daemon is 5.</help>
</field>
<field>
<id>mdnsrepeater.blocklist</id>
<label>Block List</label>
<type>text</type>
<help>Optionally to blacklist an entire subnet, (eg. 192.168.1.0/24) or individual addresses. Up to 16 subnets are supported and IPv4 subnets only.</help>
</field>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,15 @@
<Required>Y</Required>
<Multiple>Y</Multiple>
</interfaces>
<blocklist type="NetworkField">
<Default></Default>
<Required>N</Required>
<ValidationMessage>Please enter one or more valid IPv4 networks or individual addresses in CIDR notation.</ValidationMessage>
<FieldSeparator>,</FieldSeparator>
<NetMaskRequired>Y</NetMaskRequired>
<NetMaskAllowed>Y</NetMaskAllowed>
<AddressFamily>ipv4</AddressFamily>
<AsList>Y</AsList>
</blocklist>
</items>
</model>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ required_files="/var/run/mdns-repeater.CARP_MASTER"
{% do interface_list.append(physical_interface(i)) %}
{% endfor %}
mdns_repeater_interfaces="{{ interface_list | join(' ') }}"
{% if helpers.exists('OPNsense.MDNSRepeater.blocklist') and OPNsense.MDNSRepeater.blocklist != '' %}
{% set networkstobeblocked = "-b " + OPNsense.MDNSRepeater.blocklist.split(',') | join(' -b ') %}
mdns_repeater_blocklist="{{ networkstobeblocked }}"
{% endif %}
{% else %}
mdns_repeater_enable="NO"
{% endif %}