pxeboot rewrite, bridge for qemu

This commit is contained in:
bogale 2026-10-27 00:08:14 +09:00
commit 1dd7fac8ed
10 changed files with 129 additions and 112 deletions

View file

@ -16,33 +16,47 @@
nat = {
enable = true;
enableIPv6 = true;
internalInterfaces = [ "enp1s0" ];
internalInterfaces = [ "br0" ];
};
networkmanager.ensureProfiles.profiles.static-eth = {
connection = {
id = "static-eth";
networkmanager.ensureProfiles.profiles = {
slave-ethernet.connection = {
controller = "br0";
id = "slave-ethernet";
type = "ethernet";
};
ipv4 = {
addresses = "10.2.0.1/16";
method = "manual";
static-bridge = {
connection = {
id = "static-bridge";
interface-name = "br0";
type = "bridge";
};
ipv4 = {
addresses = "10.2.0.1/16";
method = "manual";
};
ipv6 = {
addresses = "fc02::1/64";
method = "manual";
};
};
ipv6 = {
addresses = "fc02::1/64";
method = "manual";
dhcp-bridge.connection = {
id = "dhcp-bridge";
interface-name = "br0";
type = "bridge";
};
};
};
services = {
dnsmasq.settings = {
bind-dynamic = true;
bind-interfaces = true;
dhcp-boot = "grubx64.efi";
dhcp-range = [
"10.2.0.2,10.2.255.254,12h"
"fc02::2,fc02::ffff:ffff:ffff:ffff,12h"
];
enable-ra = true;
enable-tftp = true;
interface = "enp1s0";
interface = "br0";
tftp-root = "/srv/tftp";
};
nfs.server = {
@ -62,7 +76,7 @@
grub2_efi
xz
];
requiredBy = [ "nfs-server.service" ];
#requiredBy = [ "nfs-server.service" ];
script = ''
if [ ! -e /srv/nfs/nixos ]; then
mkdir -p /srv/nfs/nixos