HenriWahl / dhcpy6d

MAC address aware DHCPv6 server written in Python
https://dhcpy6d.de
GNU General Public License v2.0
94 stars 27 forks source link

[Feature request] Allow interface selection by using a blacklist like dnsmasq's `except-interface=` #50

Closed xtaran closed 2 years ago

xtaran commented 2 years ago

I have two DHCPv6 servers which both have an onboard eth0 interface and a second USB-based enx<MAC address> interface which is the one I'd like to run dhcpy6d on. I'd like to streamline both dhcpy6d.conf by making dhcpy6d listen on all interfaces but eth0 (which is the upstream link interface of the router).

With dnsmasq this works easily like this (including the original explanatory comments in dnsmasq.conf):

# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.
#interface=
# Or you can specify which interface _not_ to listen on
except-interface=eth0

It would be nice if something like this would be possible with dhcpy6d as well.

HenriWahl commented 2 years ago

OK, time has come to think about this feature. Would it be enough to make this a just general setting or does it make sense to allow this per class?

HenriWahl commented 2 years ago

Latest build from https://github.com/HenriWahl/dhcpy6d/releases/tag/latest comes with an exclude_interface option - can you please test like

exclude_interface = eth0
xtaran commented 2 years ago

Would it be enough to make this a just general setting

Can innterface be used per class?

But anyway, at least from my point of view, it suffices to be a general setting.

or does it make sense to allow this per class?

For me it does not make sense since this is a safety measure to never allow DHCPv6 on e.g. the upstream link of a router.

Latest build from https://github.com/HenriWahl/dhcpy6d/releases/tag/latest comes with an exclude_interface option - can you please test like

Will probably try it on a test device later today.

Thanks!

HenriWahl commented 2 years ago

Yes, it just works as a general setting.

HenriWahl commented 2 years ago

Added in documentation at https://dhcpy6d.de/documentation/config/general