some cloud-hypervisor network fuckery, back to qemu

This commit is contained in:
Grigory Shipunov 2025-01-12 21:42:36 +00:00
parent bd44fc6fcb
commit 3771c9295b
2 changed files with 13 additions and 10 deletions

View file

@ -2,15 +2,15 @@
{
# TODO: make a module
systemd.network = {
netdevs."10-uvm-br" = {
netdevs."10-microvm" = {
netdevConfig = {
Kind = "bridge";
Name = "uvm-br";
Name = "microvm";
};
};
networks."10-uvm-br" = {
matchConfig.Name = "uvm-br";
networks."10-microvm" = {
matchConfig.Name = "microvm";
networkConfig = {
DHCPServer = false;
IPv6SendRA = true;
@ -30,9 +30,9 @@
];
};
networks."11-uvm-br" = {
networks."11-microvm" = {
matchConfig.Name = "uvm-*";
networkConfig.Bridge = "uvm-br";
networkConfig.Bridge = "microvm";
};
};
@ -40,6 +40,6 @@
enable = true;
enableIPv6 = true;
externalInterface = "enp90s0";
internalInterfaces = [ "uvm-br" ];
internalInterfaces = [ "microvm" ];
};
}

View file

@ -1,6 +1,6 @@
{ config, lib, ... }:
let
mac = "c0:ff:ee:00:00:00";
mac = "02:00:00:00:00:01";
in
{
imports = [
@ -18,7 +18,7 @@ in
};
microvm = {
hypervisor = "cloud-hypervisor";
hypervisor = "qemu";
mem = 2 * 1024;
vcpu = 2;
interfaces = [
@ -60,7 +60,10 @@ in
enable = true;
networks."11-host" = {
matchConfig.MACAddress = mac;
networkConfig.Address = "10.99.99.10/24";
networkConfig = {
Address = "10.99.99.10/24";
DHCP = "no";
};
routes = [
{
Gateway = "10.99.99.1";