Loading generate-dhcpd-conf +7 −4 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import argparse import ipaddress import json import re import socket import subprocess from typing import List Loading @@ -25,6 +26,7 @@ interface {dhcp_intf} option dns {dns} option router {gateway} option subnet {subnet} option hostname {hostname} """ def nameservers() -> List[str]: Loading Loading @@ -70,8 +72,9 @@ def generate_conf(intf_name : str) -> str: return DHCP_CONF_TEMPLATE.format( dhcp_intf = intf_name, dns = ' '.join(nameservers()), host_addr = host_addr.ip, gateway = droute['gateway'], host_addr = host_addr.ip, hostname = socket.gethostname(), subnet = host_addr.network.netmask, ) Loading run.sh +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ udhcpd -I $DUMMY_DHCPD_IP -f $DHCPD_CONF_FILE & # -serial mon:stdio: use "monitored stdio" as our serial output. # -nic: Use a TAP interface with our custom up/down scripts. # -drive: The VM image we're booting. qemu-system-x86_64 -enable-kvm -nographic -serial mon:stdio \ exec qemu-system-x86_64 -enable-kvm -nographic -serial mon:stdio \ -nic tap,id=qemu0,script=$QEMU_IFUP,downscript=$QEMU_IFDOWN \ "$@" \ -drive format=raw,file=/image Loading
generate-dhcpd-conf +7 −4 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import argparse import ipaddress import json import re import socket import subprocess from typing import List Loading @@ -25,6 +26,7 @@ interface {dhcp_intf} option dns {dns} option router {gateway} option subnet {subnet} option hostname {hostname} """ def nameservers() -> List[str]: Loading Loading @@ -70,8 +72,9 @@ def generate_conf(intf_name : str) -> str: return DHCP_CONF_TEMPLATE.format( dhcp_intf = intf_name, dns = ' '.join(nameservers()), host_addr = host_addr.ip, gateway = droute['gateway'], host_addr = host_addr.ip, hostname = socket.gethostname(), subnet = host_addr.network.netmask, ) Loading
run.sh +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ udhcpd -I $DUMMY_DHCPD_IP -f $DHCPD_CONF_FILE & # -serial mon:stdio: use "monitored stdio" as our serial output. # -nic: Use a TAP interface with our custom up/down scripts. # -drive: The VM image we're booting. qemu-system-x86_64 -enable-kvm -nographic -serial mon:stdio \ exec qemu-system-x86_64 -enable-kvm -nographic -serial mon:stdio \ -nic tap,id=qemu0,script=$QEMU_IFUP,downscript=$QEMU_IFDOWN \ "$@" \ -drive format=raw,file=/image