Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Allocating a MAC address: allocmac.py

The page "HWDB MAC address pool" file "macfile" in the same directory as this software shows which of the DAT group's MAC address have been allocated and which are still free. allocmac.py reads the pagefile, allocates one MAC address, updates the page and prints the allocated address on stdout. This command requires a token generated by hwdblogin.pyFor testing purposes allocmac.py can take an option --macfile which specifies a MAC address file different from the default.

bash-3.2$ mac=$(allocmac.py --loginmacfile $tokenmymacs)
bash-3.2$ echo $mac
08:00:56:00:43:38

The MAC file read by allocmac.py must consist of exactly three lines. The first line contains the first address in the block assigned to the DAT group (or your test block). The second line contains the first free address. The third line contains the last address in the assigned block. For example:

08:00:56:00:40:00
08:00:56:00:43:31
08:00:56:00:7f:ff

Checking pages for validity: checkpage.py

...