|
From: | Gary Allen |
Subject: | qemu on macos, VM can't ping ip on bridge0 |
Date: | Sun, 12 Apr 2020 16:02:09 +0800 |
I installed qemu on macos and use a tap device in the vm. Below are my steps.
install qemu
brew install qemu
install tuntap, after installation, I can see tap devices in /dev/tapX
brew install tuntap
create a bridge
sudo ifconfig bridge0 create
configure ip address on bridge0
sudo ifconfig bridge0 192.168.122.1/24
sudo ifconfig bridge0 up
start my qemu vm (which is centos), and log in to the vm, mannually configure the static ip address as 192.168.122.101/24, gateway is 192.168.122.1.
sudo qemu-system-x86_64 -m 2048 -vga virtio -show-cursor -usb -device usb-tablet -drive file=centos-temp.qcow2,if=virtio -accel hvf -cpu host -net nic -net tap,ifname=tap0,script=no,downscript=no
after the vm starts, I can see a tap0 in the output of ifconfig, and I add tap0 to bridge0
sudo ifconfig bridge0 addm tap0
however, after theses steps, I cant's ping 192.168.122.1 in my vm, and neither can I ping 192.168.122.101 in my mac host.
What am I doing wrong?
[Prev in Thread] | Current Thread | [Next in Thread] |