EasyG0ing1 / Migration

Migration is a tool to assist with migrating your OPNsense DHCP static mappings over to the new Kea DHCP server that comes with version 24 of OPNsense.
43 stars 1 forks source link

Error in Linux - XML Node: <mac> Could not be found #4

Closed westy closed 4 months ago

westy commented 4 months ago

Hi,

Getting an error when running the tool.

Problem:
       XML Node: <mac>
       Could not be found

  Thoughts:
       This node is supposed to exist within each section in the config.xml file that is tagged
       with <staticmap></staticmap>. Please look through your config.xml file and search for
       `<staticmap` (without the tick marks) and make sure each one has an assigned and valid
        mac address.

Here is a slightly snipped and redacted version of the config.xml:

<?xml version="1.0"?>
<opnsense>
  <!-- SNIP -->
  <dhcpd>
    <lan>
      <enable>1</enable>
      <domain>REDACTED.NET</domain>
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>
      <numberoptions>
        <item/>
      </numberoptions>
      <range>
        <from>192.168.1.100</from>
        <to>192.168.1.199</to>
      </range>
      <winsserver/>
      <dnsserver/>
      <ntpserver/>
      <staticmap>
        <mac>04:7c:16:6d:dc:d2</mac>
        <ipaddr>192.168.1.2</ipaddr>
        <hostname>Monty</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>18:e8:29:48:7d:2f</mac>
        <ipaddr>192.168.1.3</ipaddr>
        <hostname>UnderstairsSwitch</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>b4:fb:e4:8b:3a:f1</mac>
        <ipaddr>192.168.1.4</ipaddr>
        <hostname>UnderstairsAP</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>74:83:c2:0c:1a:7f</mac>
        <ipaddr>192.168.1.5</ipaddr>
        <hostname>LoftSwitch</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>74:83:c2:0c:1a:80</mac>
        <ipaddr>192.168.1.6</ipaddr>
        <hostname>LoungeSwitch</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>74:83:c2:0c:1a:f7</mac>
        <ipaddr>192.168.1.7</ipaddr>
        <hostname>PlayroomSwitch</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>f4:92:bf:aa:c2:5c</mac>
        <ipaddr>192.168.1.8</ipaddr>
        <hostname>GarageAP</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <cid>MariaDB</cid>
        <ipaddr>192.168.1.10</ipaddr>
        <hostname>MariaDB</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <cid>Homebridge</cid>
        <ipaddr>192.168.1.12</ipaddr>
        <hostname>Homebridge</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>52:54:00:3e:c2:cf</mac>
        <ipaddr>192.168.1.13</ipaddr>
        <hostname>WinDocker01</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>40:6c:8f:b9:af:84</mac>
        <ipaddr>192.168.1.20</ipaddr>
        <hostname>Otto</hostname>
        <descr>Innermost interface on the Mac Pro</descr>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>40:6c:8f:b9:88:bf</mac>
        <ipaddr>192.168.1.21</ipaddr>
        <hostname>Otto2</hostname>
        <descr>Outermost interface on the Mac Pro</descr>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>00:1f:29:60:2a:dd</mac>
        <ipaddr>192.168.1.22</ipaddr>
        <hostname>Stampy</hostname>
        <descr>Port 3 on Monty's ethernet card</descr>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>4c:20:b8:ab:25:d6</mac>
        <ipaddr>192.168.1.24</ipaddr>
        <hostname>Wiggum</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>84:3a:4b:6a:05:d8</mac>
        <ipaddr>192.168.1.25</ipaddr>
        <hostname>Patty</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>00:0e:c6:fe:24:4f</mac>
        <ipaddr>192.168.1.26</ipaddr>
        <hostname>A00173_USB</hostname>
        <descr>USB ethernet adapter</descr>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>3c:a6:f6:36:e2:6e</mac>
        <ipaddr>192.168.1.27</ipaddr>
        <hostname>Partners-Air</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>f8:4d:89:67:29:69</mac>
        <ipaddr>192.168.1.28</ipaddr>
        <hostname>Bart_wireless</hostname>
        <descr>Bart (WiFi)</descr>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>c8:7f:54:67:62:dd</mac>
        <ipaddr>192.168.1.29</ipaddr>
        <hostname>Krusty</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>5e:77:a3:4f:ee:66</mac>
        <ipaddr>192.168.1.50</ipaddr>
        <hostname>iPad</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>00:18:dd:25:24:46</mac>
        <ipaddr>192.168.1.60</ipaddr>
        <hostname>HDHomeRun</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <pool/>
    </lan>
    <opt1>
      <enable>1</enable>
      <domain>REDACTED.NET</domain>
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>
      <numberoptions>
        <item/>
      </numberoptions>
      <range>
        <from>192.168.3.100</from>
        <to>192.168.3.199</to>
      </range>
      <winsserver/>
      <dnsserver/>
      <ntpserver/>
      <staticmap>
        <mac>7c:ed:8d:1c:41:4c</mac>
        <hostname>Xbox360</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>04:7c:16:6d:dc:d2</mac>
        <ipaddr>192.168.3.2</ipaddr>
        <hostname>Monty</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <cid>TimeMachine</cid>
        <ipaddr>192.168.3.3</ipaddr>
        <hostname>TimeMachine</hostname>
        <descr>TimeMachine docker on unRAID</descr>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>52:54:00:3e:c2:cf</mac>
        <ipaddr>192.168.3.4</ipaddr>
        <hostname>WinDocker01</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <cid>Minecraft Docker</cid>
        <ipaddr>192.168.3.5</ipaddr>
        <hostname>MinecraftDocker</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>e0:bb:9e:ab:c9:e5</mac>
        <ipaddr>192.168.3.10</ipaddr>
        <hostname>Eppy</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>40:6c:8f:b9:88:bf</mac>
        <ipaddr>192.168.3.11</ipaddr>
        <hostname>Otto3</hostname>
        <descr>Otto (Outermost NIC)</descr>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>f8:4d:89:67:29:69</mac>
        <ipaddr>192.168.3.12</ipaddr>
        <hostname>Bart</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>20:c1:9b:99:0b:83</mac>
        <ipaddr>192.168.3.13</ipaddr>
        <hostname>WORKLAPTOP</hostname>
        <descr>Partner's work laptop</descr>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>3c:a6:f6:36:e2:6e</mac>
        <ipaddr>192.168.3.14</ipaddr>
        <hostname>Partners-Air</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>c8:7f:54:67:62:dd</mac>
        <ipaddr>192.168.3.15</ipaddr>
        <hostname>Krusty</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>00:be:43:33:af:5b</mac>
        <ipaddr>192.168.3.16</ipaddr>
        <hostname>WORKLAPTOP</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>48:e7:da:2b:52:7d</mac>
        <ipaddr>192.168.3.17</ipaddr>
        <hostname>SantasLilHelper</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>b4:e6:2a:cc:96:aa</mac>
        <ipaddr>192.168.3.20</ipaddr>
        <hostname>LG_TV</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>1c:12:b0:a7:da:06</mac>
        <ipaddr>192.168.3.21</ipaddr>
        <hostname>Firestick4k</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>64:b5:c6:18:2d:71</mac>
        <ipaddr>192.168.3.30</ipaddr>
        <hostname>NintendoSwitch</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>84:57:33:94:a1:af</mac>
        <ipaddr>192.168.3.31</ipaddr>
        <hostname>PlayroomX</hostname>
        <descr>Xbox One X Ethernet</descr>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>70:bc:10:10:7e:e9</mac>
        <ipaddr>192.168.3.32</ipaddr>
        <hostname>LoungeS</hostname>
        <descr>Xbox One S Ethernet</descr>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>70:bc:10:10:7e:eb</mac>
        <ipaddr>192.168.3.33</ipaddr>
        <hostname>LOUNGE-S-Wireless</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>d8:e2:df:34:0d:1f</mac>
        <ipaddr>192.168.3.34</ipaddr>
        <hostname>XBOX-Series-X</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>14:60:cb:18:10:b1</mac>
        <ipaddr>192.168.3.40</ipaddr>
        <hostname>Kid1s-iPhone</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>44:35:83:71:31:a8</mac>
        <ipaddr>192.168.3.41</ipaddr>
        <hostname>Partners-iPhone</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>a4:cf:99:28:d4:1d</mac>
        <ipaddr>192.168.3.42</ipaddr>
        <hostname>My-iPhone</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>08:8e:dc:86:5f:36</mac>
        <ipaddr>192.168.3.43</ipaddr>
        <hostname>Partnersione12Pro</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>12:05:d2:02:31:ed</mac>
        <ipaddr>192.168.3.44</ipaddr>
        <hostname>Kid2s-iPhone</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>60:8c:4a:84:47:87</mac>
        <ipaddr>192.168.3.50</ipaddr>
        <hostname>iPad</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>e4:58:e7:46:ec:66</mac>
        <ipaddr>192.168.3.51</ipaddr>
        <hostname>Kid2s-Tablet</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>94:9f:3e:e0:6b:f4</mac>
        <ipaddr>192.168.3.60</ipaddr>
        <hostname>SonosZP</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>a4:4e:31:b5:55:1c</mac>
        <ipaddr>192.168.3.70</ipaddr>
        <hostname>MIKE_THINKPAD</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <pool/>
    </opt1>
    <opt2>
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>
      <numberoptions>
        <item/>
      </numberoptions>
      <range>
        <from>192.168.10.200</from>
        <to>192.168.10.245</to>
      </range>
      <winsserver/>
      <dnsserver/>
      <ntpserver/>
    </opt2>
    <opt3>
      <enable>1</enable>
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>
      <numberoptions>
        <item/>
      </numberoptions>
      <range>
        <from>192.168.10.100</from>
        <to>192.168.10.199</to>
      </range>
      <winsserver/>
      <dnsserver/>
      <ntpserver/>
      <staticmap>
        <mac>04:7c:16:6d:dc:d2</mac>
        <ipaddr>192.168.10.2</ipaddr>
        <hostname>Monty</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <pool/>
    </opt3>
    <opt6>
      <enable>1</enable>
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>
      <numberoptions>
        <item/>
      </numberoptions>
      <range>
        <from>192.168.11.100</from>
        <to>192.168.11.199</to>
      </range>
      <winsserver/>
      <dnsserver/>
      <ntpserver/>
      <staticmap>
        <mac>04:7c:16:6d:dc:d2</mac>
        <ipaddr>192.168.11.2</ipaddr>
        <hostname>Monty</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <pool/>
    </opt6>
    <opt7>
      <enable>1</enable>
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>
      <numberoptions>
        <item/>
      </numberoptions>
      <range>
        <from>192.168.12.100</from>
        <to>192.168.12.199</to>
      </range>
      <winsserver/>
      <dnsserver/>
      <ntpserver/>
      <staticmap>
        <mac>04:7c:16:6d:dc:d2</mac>
        <ipaddr>192.168.12.2</ipaddr>
        <hostname>Monty</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <pool/>
    </opt7>
    <opt9>
      <enable>1</enable>
      <domain>REDACTED.NET</domain>
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>
      <numberoptions>
        <item/>
      </numberoptions>
      <range>
        <from>192.168.2.100</from>
        <to>192.168.2.199</to>
      </range>
      <winsserver/>
      <dnsserver/>
      <ntpserver/>
      <staticmap>
        <mac>04:7c:16:6d:dc:d2</mac>
        <ipaddr>192.168.2.2</ipaddr>
        <hostname>Monty</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>9c:b6:d0:97:6f:d9</mac>
        <ipaddr>192.168.2.10</ipaddr>
        <hostname>A00173</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <mac>04:e8:b9:6b:fe:db</mac>
        <ipaddr>192.168.2.11</ipaddr>
        <hostname>A00331</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
    </opt9>
  </dhcpd>
  <!-- SNIP -->
</opnsense>

I'm guessing might be that first slightly odd entry for the 192.168.10.0/24 subnet.

I'll doublecheck the ISC settings for it I guess.

Cheers

westy commented 4 months ago

Hmm, all look identical in the UI. I'll try hacking the spurious section out of the XML I guess.

Anyway, thought you might be interested, but no rush on addressing if I can work around it.

Cheers

westy commented 4 months ago

Nope, hacking that opt2 entry out didn't seem to help. Hmm.

EasyG0ing1 commented 4 months ago

@westy

Looking at your config.xml file, these first two static entries would have caused the error actually just the first one would have thrown the error):

      <staticmap>
        <cid>MariaDB</cid>
        <ipaddr>192.168.1.10</ipaddr>
        <hostname>MariaDB</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>
      <staticmap>
        <cid>Homebridge</cid>
        <ipaddr>192.168.1.12</ipaddr>
        <hostname>Homebridge</hostname>
        <winsserver/>
        <dnsserver/>
        <ntpserver/>
      </staticmap>

The program isn't set to handle \ I need to think about how to go about this. I'll see if Kea has an equal setting.

EasyG0ing1 commented 4 months ago

@westy

Upon some light digging into this, Kea definitely does support CID (in fact it is fully compliant with all RFCs concerning DHCP) and it looks like Kea implemented GUID strings to be able to connect IPv4 mappings with IPv6 mappings where it will be able to connect a v4 and a v6 address with the same client.

However, it doesn't seem like OPNsense exposes the CID feature of Kea to it's interface yet. I'm assuming that they have plans to expand the interface to Kea in later releases where they will unlock more features of Kea and that the current abilities that are exposed in OPNsense were just the basics and that was probably done in an effort to get Kea out there so people can start using it while they port over all features over time.

I'm thinking what I will most likely do, is when Migrate finds a staticmap where there is a CID used and not a MAC address, I will just list those out in a separate file (like cid.txt) and inform the user at the end of the migration process that the mappings in that file were not ported over to Kea so that they can figure out how to best handle those mappings in their environment.

westy commented 4 months ago

Hi @EasyG0ing1,

Ah, that makes sense.

Those are some fixed IPs for some docker containers that I want to be able to look up in DNS, and since DHCP addresses are included there, that's what I did. Saying that, the Homebridge didn't work out so can remove that one, and can add a DNS entry for the other, so will remove and report back.

Thanks for looking.

Cheers, Westy

EasyG0ing1 commented 4 months ago

@westy

When you assign a hostname to your static IP entry, OPNsense will resolve that name to the assigned IP address as long as whatever is trying to connect to it is using OPNsense as its DNS server. In the Kea DHCP settings, under the Subnets tab, you can assign a domain name to each subnet. I simply use the word 'home'.

So for example, if I have a hostname assigned to a mapping using the word 'web' (like for a linux VM that I use as a test web server). Once that assignment is given to the VM, I can just go to a web browser and put in http://web.home and OPNsense will resolve the IP address for me. You can, of course, do the same thing in the terminal ping web.home etc.

Thanks for posting the issue, as this will help me make the program more fault tolerant.

Mike

EasyG0ing1 commented 4 months ago

@westy

FYI, here is what your error message would have looked like in the update that I am going to post soon:

 Problem:
       You have static mappings that only have a CID assigned to them without a MAC address.
       As of April 2024, Kea DHCP server does support either MAC address or CID as a valid
       identifier. However, OPNsense has not yet included the CID feature of Kea DHCP and it is
       assumed that it will be included in a future update.

       You have two options if you wish to include these mappings:

       1) Proceed with the migration and import new_config.xml into OPNsense, then add these
          mappings manually under Services / Kea DHCP / Kea DHCPv4 / Reservations.

       2) Go back into your ISC static mappings and clear the CID value and assign the mapping
          A proper MAC address. Then start the migration process over again from step 1.

       Here are the static mappings that have NOT been ported to Kea:

           IP Address:  10.10.10.5
           Hostname:    MariaDB
           Description: Maria Database Server

           IP Address:  10.10.10.6
           Hostname:    Homebridge
           Description: Homebridge Server
westy commented 4 months ago

Looks good. Cheers!

westy commented 4 months ago

Finally got around to trying it again (since wouldn't run on my Apple Silicon Mac), and has worked well. A few entries without macs, but I can address those in other ways.

Thanks for the useful tool!

EasyG0ing1 commented 4 months ago

@westy Can't the silicon macs run x86 compiled code?

westy commented 4 months ago

@EasyG0ing1 Yeah, silicon macs use Rosetta to run x86 code, and are very good at it. Seems there is something about the execuable it doesn't like though.

The error response is:

The current machine does not support all of the following CPU features that are required by the image: [CX8, CMOV, FXSR, MMX, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, POPCNT, LZCNT, AVX, AVX2, BMI1, BMI2, FMA, F16C].
Please rebuild the executable with an appropriate setting of the -march option.⏎ 

Tried on an M1 mac mini and an M1 Pro Macbook Pro, so maybe the M2 or M3 would have better luck, but probably not - sorry, I don't have one of them.

If need me to try another please let me know.

EasyG0ing1 commented 4 months ago

@westy

Try this one in Rosetta and see if it works

migrate.zip

westy commented 4 months ago

@EasyG0ing1 Yeah, that one runs. Good work!

EasyG0ing1 commented 4 months ago

@westy

Awesome! It seems it was just a need to tell the compiler to compile for 'compatible' CPUs ... where it has these options:

On AMD64, the following machine types are available:

'compatibility'
  CPU features: all of 'x86-64'
'haswell'
  CPU features: all of 'x86-64' + SSE3 + SSSE3 + SSE4_1 + SSE4_2 + POPCNT + LZCNT + AVX + AVX2 + AES + CLMUL + BMI1 + BMI2 + FMA + F16C
'native'
  CPU features: CX8 + CMOV + FXSR + HT + MMX + AMD_3DNOW_PREFETCH + SSE + SSE2 + SSE3 + SSSE3 + SSE4_1 + SSE4_2 + POPCNT + LZCNT + TSC + TSCINV_BIT + AVX + AVX2 + AES + ERMS + CLMUL + BMI1 + BMI2 + ADX + FMA + VZEROUPPER + FLUSH + FLUSHOPT + RDTSCP + F16C
'skylake'
  CPU features: all of 'haswell' + AMD_3DNOW_PREFETCH + ADX + FLUSHOPT
'skylake-avx512'
  CPU features: all of 'skylake' + AVX512F + AVX512DQ + AVX512CD + AVX512BW + AVX512VL + CLWB + PKU
'x86-64'
  CPU features: CX8 + CMOV + FXSR + MMX + SSE + SSE2
'x86-64-v1'
  CPU features: all of 'x86-64'
'x86-64-v2'
  CPU features: all of 'x86-64-v1' + SSE3 + SSSE3 + SSE4_1 + SSE4_2 + POPCNT
'x86-64-v3'
  CPU features: all of 'x86-64-v2' + LZCNT + AVX + AVX2 + BMI1 + BMI2 + FMA + F16C
'x86-64-v4'
  CPU features: all of 'x86-64-v3' + AVX512F + AVX512DQ + AVX512CD + AVX512BW + AVX512VL

So it was just a simple matter of adding one argument to the compile command and that did the trick ☺