Configuring TUN/TAP virtual network interface for use with QEMU on Xubuntu 24.04
I am planning to run qemu-system-ppc to play around QEMU and PPC with networking support. The quest and U-Boot will need to interact with external services, namely, tftp. The recommended network is to have TUN/TAP virtual network interface configured on the host. My host is Xubuntu 24.04/Ubuntu 24.04.Let's start by creating tap0 using systemd
u1@m18:~$ sudo nvim /etc/systemd/system/tap0.service
Run command below to create tap0. This should also presist after reboot
u1@m18:~$ sudo systemctl daemon-reexec u1@m18:~$ sudo systemctl enable --now tap0.service
u1@m18:~$ mkdir ~/backup u1@m18:~$ cd /etc/netplan u1@m18:~$ sudo mv * ~/backup
u1@m18:~$ sudo touch /etc/netplan01-netcfg.yaml u1@m18:~$ sudo chmod 600 /etc/netplan/01-netcfg.yaml u1@m18:~$ sudo nvim /etc/netplan/01-netcfg.yaml
Now disable Network Manager and enable networkd. The command below will reconfure your network, so you need to be on the console and not via ssh.
u1@m18:~$ sudo systemctl stop NetworkManager.service u1@m18:~$ sudo systemctl disable NetworkManager.service u1@m18:~$ sudo systemctl start systemd-networkd.service u1@m18:~$ sudo systemctl enable systemd-networkd.service
u1@m18:~$ sudo netplan apply
u1@m18:~$ qemu-system-ppc -M mpc8544ds -cpu mpc8540 -m 512 -nographic -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device e1000,netdev=net0 -serial mon:stdio
No comments:
Post a Comment