Skip to content

Expand mDNS settings#833

Merged
wkz merged 10 commits intomainfrom
mdns-settings
Dec 4, 2024
Merged

Expand mDNS settings#833
wkz merged 10 commits intomainfrom
mdns-settings

Conversation

@troglobit
Copy link
Contributor

@troglobit troglobit commented Nov 24, 2024

Description

This PR adds support for modifying the following Avahi daemon settings:

  • domain-name
  • allow-interfaces
  • deny-interfaces
  • enable-reflector
  • reflect-filters

Also included, a review of the default sysctl settings, and some fixes and clarifications to the Networking Guide.

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

@troglobit troglobit added this to the Infix v24.11.1 milestone Nov 24, 2024
@troglobit troglobit self-assigned this Nov 24, 2024
@troglobit troglobit added the enhancement New feature or request label Nov 24, 2024
@troglobit troglobit linked an issue Nov 25, 2024 that may be closed by this pull request
@troglobit troglobit linked an issue Dec 3, 2024 that may be closed by this pull request
@troglobit
Copy link
Contributor Author

@mattiaswal + @jovatn this PR is now finished and awaiting your review.

Copy link
Contributor

@jovatn jovatn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update https://github.com/kernelkit/infix/blob/main/doc/discovery.md#mdns with (rudimentary) descriptions of available mdns settings.

sysctl updates looks good to me, but perhaps we could have an IRL session for rubber ducking on sysctl changes?

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
These changes are based on the sysctl recommendations by Frr [1].

Not all recommendations have been incorporated, e.g., ip forwarding is
not enabled per interface, because in Infix this is an opt-in feature.

A readme.txt has been added, documenting the various settings.

New for IPv4:
 - Adjust IGMP max memberships: 20 -> 1000
 - Use neighbor information on nexthop selection
 - Use inbound interface address on ICMP errors
 - Ignore routes with link down
 - Disable rp_filter

ARP settings have been changed to better fit routers, i.e., systems
with multiple interfaces:

 - Always use best local address when sending ARP
 - Only reply to ARP if target IP is on the inbound interface
 - Generate ARP requests when device is brought up or HW address changes

New for IPv6:
 - Keep static global addresses on link down
 - Ignore routes with link down

Fixes #829

[1]: https://github.com/FRRouting/frr/blob/master/doc/user/Useful_Sysctl_Settings.md

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit troglobit force-pushed the mdns-settings branch 2 times, most recently from fef6de8 to 4d26e39 Compare December 4, 2024 10:41
Use container for interface allow/deny and for reflector settings.
Hopefully there will be more settings in the future, e.g., control
reflector interfaces independently.

Fix #678

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The Avahi daemon needs to be restarted when changing its configuration
file in /etc/avahi/avahi-daemon.conf, not sufficient to SIGHUP.

Also, minor reformatting for new style.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Fixes the following issue when deleting /infix-services:mdns/interfaces,
which works fine over RESTCONF:

Traceback (most recent call last):
  File "/home/jocke/src/infix/test/./case/infix_services/mdns_allow_deny/test.py", line 142, in <module>
    dut.delete_xpath("/infix-services:mdns/interfaces")
  File "/home/jocke/src/infix/test/infamy/netconf.py", line 418, in delete_xpath
    oldd = mod.parse_data_dict(old, no_state=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/schema.py", line 215, in parse_data_dict
    return dict_to_dnode(
           ^^^^^^^^^^^^^^
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/data.py", line 1277, in dict_to_dnode
    result.root().validate(
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/data.py", line 430, in validate
    self.validate_all(no_state, validate_present)
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/data.py", line 449, in validate_all
    raise self.context.error("validation failed")
libyang.util.LibyangError: validation failed:
    Invalid leafref value "e3" - no target instance "/if:interfaces/if:interface/if:name" with the same value.

The patch skips validation of the diff in favor of checking the result
of libyang.xpath_del().

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Overhaul text and grammar.  Simplify, correct, and add information about
the new mDNS settings.  Replace 'unit' with 'device', which is the more
common term for hardware.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Copy link
Contributor

@mattiaswal mattiaswal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@wkz wkz merged commit 42b7cf9 into main Dec 4, 2024
@wkz wkz deleted the mdns-settings branch December 4, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Review sysctl settings mdns: expose more Avahi configuration settings

4 participants