Akkadius / glass-isc-dhcp

Glass - ISC DHCP Server Interface
MIT License
684 stars 142 forks source link

Add auto detect of generated MACs from XEN and other HyperVisors #68

Open marl-scot opened 4 years ago

marl-scot commented 4 years ago

Have been trying to find a way to make Glass show a vendor string of 'XEN Guest' (or 'Generated' for a more generic network) for any MAC addresses that have the 1st and 2nd bits of the first byte set to indicate a software generated address. Under the 'MAC addresses' section on : https://wiki.xenproject.org/wiki/Xen_Networking You can see that bit 2 being set of the first byte being set should indicate a locally administered MAC and bit 1 one being cleared indicates no-multicast (not sure if this bit should be checked or not!). Idea is to check if the MAC has been found, and if not, then check for at least bit 2 being set and if so, set the vendor to 'XEN Guest' (the string could be anything, as I only use XEN in my network, then this makes sense to my system) Another option, although more complicated would be to allow configuring a set of regexes in the glass config file that would be matched against MAC addresses if vendor can't be found. If anyone could look at this, that would be great, or even point me to the files/lines that I would need to modify for the basic change would be great, although I am a PHP dev, and have no node/perl experience!)