Nixos VMにはdhcpcdを介してIPv4アドレスが割り当てられていません。

Nixos VMにはdhcpcdを介してIPv4アドレスが割り当てられていません。

次のオプションで仮想マシン設定を使用しています。

    qemu.networkingOptions = [
                               "-device e1000,netdev=abc,mac=52:55:00:d1:55:02"
                               "-netdev tap,id=abc,ifname=tapB,script=no,downscript=no"
                             ];

ただし、IPv4 は割り当てられません。dhcpcdサービスを確認して手動で実行すると、次の結果が表示されます。

dhcpcd -w --config /nix/store/vvcrfgj2ni09gqc9l4rin9aq8asp73k9-dhcpcd.conf
dev: loaded udev
DUID 00:01:00:01:25:dc:a1:45:52:54:00:12:34:56
eth0: IAID 00:d1:55:02
eth0: adding address fe80::5055:ff:fed1:5502
eth0: soliciting a DHCP lease
eth0: soliciting an IPv6 router
eth0: no IPv6 Routers available
timed out
forked to background, child pid 752

パラメータなしで実行すると、次のように表示されます。

dhcpcd
read_config: fopen `/etc/dhcpcd.conf': No such file or directory
dev: loaded udev
read_config: fopen `/etc/dhcpcd.conf': No such file or directory
DUID 00:01:00:01:25:dc:a1:45:52:54:00:12:34:56
eth0: IAID 00:d1:55:02
eth0: adding address fe80::5055:ff:fed1:5502
eth0: soliciting a DHCP lease
eth0: soliciting an IPv6 router
eth0: probing for an IPv4LL address
eth0: using IPv4LL address 169.254.228.140
eth0: adding route to 169.254.0.0/16
eth0: adding default route
forked to background, child pid 705

IPv4を展開するようにNixos / nixを設定する方法は?


問題のある構成ファイル:

cat /nix/store/vvcrfgj2ni09gqc9l4rin9aq8asp73k9-dhcpcd.conf
# Inform the DHCP server of our hostname for DDNS.
hostname

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes, ntp_servers, interface_mtu

# A ServerID is required by RFC2131.
# Commented out because of many non-compliant DHCP servers in the wild :(
#require dhcp_server_identifier

# A hook script is provided to lookup the hostname if not set by
# the DHCP server, but it should not be run by default.
nohook lookup-hostname

# Ignore peth* devices; on Xen, they're renamed physical
# Ethernet cards used for bridging.  Likewise for vif* and tap*
# (Xen) and virbr* and vnet* (libvirt).
denyinterfaces ve-* vb-* lo peth* vif* tap* tun* virbr* vnet* vboxnet* sit*

# Use the list of allowed interfaces if specified



noarp

ベストアンサー1

VLANまたは仮想ネットワークを定義する必要があります。 virt-manager GUI を使用して動作する仮想マシンを作成し、Qemu 構成をお客様の構成と比較します。仮想マシンがNATホストではなく物理ネットワーク上にあるようにするには、ブリッジを使用してネットワークデバイスをサポートします。

おすすめ記事