我嘗試在 QEMU 上運行虛擬機,但虛擬機已啟動,但沒有與 eth0 關聯的 IP 位址。我在主機上配置了橋接和分接接口,我可以看到:
brctl show bro
bridge name bridge id STP enabled interfaces
bro 8000.bedc8d16e7d8 no eno1
tap0
介面看起來不錯:
ip addr show bro
3: bro: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether be:dc:8d:16:e7:d8 brd ff:ff:ff:ff:ff:ff
inet 192.168.100.112/24 brd 192.168.100.255 scope global dynamic bro
valid_lft 540129sec preferred_lft 540129sec
inet6 fe80::bcdc:8dff:fe16:e7d8/64 scope link
valid_lft forever preferred_lft forever
ip addr show eno1
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master bro state UP group default qlen 1000
link/ether 98:90:96:9d:d9:83 brd ff:ff:ff:ff:ff:ff
ip addr show tap0
8: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master bro state DOWN group default qlen 1000
link/ether d2:74:5b:04:81:f8 brd ff:ff:ff:ff:ff:ff
inet 192.168.100.222/24 brd 192.168.100.255 scope global tap0
valid_lft forever preferred_lft forever
這是我用來運行虛擬機器的命令:
sudo qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=CentOS-7-aarch64-Minimal-1810.iso,id=hd0 -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0,mac=bc:dc:8d:16:e7:d8, -hda centos7-arm.img
在來賓上沒有 IP,即使 DHCP 沒有:
[root@localhost ~]# ip link show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether bc:dc:8d:16:e7:d8 brd ff:ff:ff:ff:ff:ff
我嘗試從 centos nmtui 配置後,服務網路重新啟動失敗。日誌中發現:
localhost.localdomain網路[4058]:啟動介面eth0:錯誤:連線啟動失敗:無法保留IP設定(無可用位址、逾時等)
您知道可能出了什麼問題嗎?