add ip and mac arithmatic functions

calculate vm mac addresses
This commit is contained in:
Pim Kunis 2024-02-01 22:57:18 +01:00
parent beb1c384ec
commit 885cba2f30
4 changed files with 1344 additions and 6 deletions

View file

@ -64,7 +64,7 @@
nixosModule = { pkgs, ... }: {
# TODO: would be cool to create a check that a mac address is only ever assigned to one VM.
lab.vm.macAddress = "BA:DB:EE:F0:00:00";
lab.vm.id = 0;
programs.bash.interactiveShellInit = ''
echo "Hello world from inside a virtual machine!!" | ${pkgs.lolcat}/bin/lolcat
@ -81,7 +81,7 @@
networking.dmz.services.enable = true;
vm = {
macAddress = "BA:DB:EE:F0:00:07";
id = 7;
staticNetworking = true;
staticIPv4 = config.lab.networking.dmz.ipv4.services;
staticIPv6 = config.lab.networking.dmz.ipv6.services;