diff options
-rw-r--r-- | conf/dnsmasq.conf | 5 | ||||
-rwxr-xr-x | src/qemu.sh | 15 |
2 files changed, 19 insertions, 1 deletions
diff --git a/conf/dnsmasq.conf b/conf/dnsmasq.conf index 7200efc..5ab9008 100644 --- a/conf/dnsmasq.conf +++ b/conf/dnsmasq.conf | |||
@@ -4,6 +4,11 @@ dhcp-range=192.168.10.10,192.168.10.253,255.255.255.0,1h | |||
4 | enable-tftp | 4 | enable-tftp |
5 | 5 | ||
6 | dhcp-host=52:54:00:12:34:56,samizdoot-vm,192.168.10.82 | 6 | dhcp-host=52:54:00:12:34:56,samizdoot-vm,192.168.10.82 |
7 | dhcp-host=52:54:00:12:34:57,samizdote-vm,192.168.10.83 | ||
8 | dhcp-host=52:54:00:12:34:58,samizdeet-vm,192.168.10.84 | ||
9 | dhcp-host=52:54:00:12:34:59,samizdite-vm,192.168.10.85 | ||
10 | dhcp-host=52:54:00:12:34:5A,samizdate-vm,192.168.10.86 | ||
11 | |||
7 | #dhcp-host=f0:de:f1:5a:ac:e8,samizdoot-irl,192.168.10.82 | 12 | #dhcp-host=f0:de:f1:5a:ac:e8,samizdoot-irl,192.168.10.82 |
8 | 13 | ||
9 | pxe-service=x86PC, "Samizdat", pxelinux | 14 | pxe-service=x86PC, "Samizdat", pxelinux |
diff --git a/src/qemu.sh b/src/qemu.sh index 2ae982d..130b688 100755 --- a/src/qemu.sh +++ b/src/qemu.sh | |||
@@ -30,7 +30,20 @@ kcmdline_CDROM='boot=samizdat components quiet splash' | |||
30 | kcmdline_CDROM_NET="${kcmdline_CDROM} nbdroot=,${nbd_filename}, nbddev=/dev/nbd0 ip=dhcp" | 30 | kcmdline_CDROM_NET="${kcmdline_CDROM} nbdroot=,${nbd_filename}, nbddev=/dev/nbd0 ip=dhcp" |
31 | kcmdline_NET="${kcmdline_CDROM_NET} netkeys" | 31 | kcmdline_NET="${kcmdline_CDROM_NET} netkeys" |
32 | 32 | ||
33 | MAC='52-54-00-12-34-56' | 33 | find_mac() |
34 | { | ||
35 | start_mac=$1 | ||
36 | for mac in $(ip link show | grep link/ether | (read _ mac _; echo $mac | tr : -)); do | ||
37 | if [ "${mac%??}" = "${start_mac%??}" ]; then | ||
38 | prefix=${mac%??} | ||
39 | suffix=$(printf %x $(( 0x${mac##*-} + 1 ))) | ||
40 | MAC=${prefix}${suffix} | ||
41 | return | ||
42 | fi | ||
43 | done | ||
44 | MAC=$start_mac | ||
45 | } | ||
46 | find_mac 52-54-00-12-34-56 | ||
34 | 47 | ||
35 | kcmdline_BOOTIF="BOOTIF=01-$MAC" | 48 | kcmdline_BOOTIF="BOOTIF=01-$MAC" |
36 | 49 | ||