[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: missing info in the document for qemu networking (where to find linu
From: |
ckim |
Subject: |
RE: missing info in the document for qemu networking (where to find linux-test-xxx.tar.gz) (TAP networking) |
Date: |
Wed, 11 Aug 2021 18:27:20 +0900 |
Hi, Peter Maydell and all,
>
> Pretty sure that's just ancient out of date documentation. Anything that
> points to a random tar.gz file is probably years out of date.
> Jason, is there up to date information on setting up TAP somewhere?
>
Thanks,
I found https://wiki.qemu.org/Documentation/Networking (it would be good to
show this link in the main documentation's network part.)
And I tried that with this setup.
sudo ip link add br0 type bridge
sudo tuntap add dev tap0 mode tap
sudo ip tuntap add dev tap0 mode tap
sudo ip link set dev tap0 master br0
sudo ip link set dev enp6s0 master br0
sudo ip link set dev br0 up
sudo ip address delete 129.254.31.181/24 dev enp6s0
sudo ip address add 129.254.31.181/24 dev br0
sudo ip route add default via 129.254.31.1 dev br0
#sudo systemctl stop firewalld
#-netdev tap,id=mynet0,ifname=tap0,script=no,downscript=no -device
e1000,netdev=mynet0,mac=DE:AD:BE:EF:61:5C \
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib::/usr/local/cuda/lib64:/usr/local/cuda/lib64:/home/ckim/prj/abdsn/ab21sim/axpusim/build
&&
./qemu-system-aarch64 -nographic -machine
ab21q,gic-version=max,iommu=smmuv3 -m 1G -cpu max -smp 4 \
-netdev tap,id=vnet,ifname=tap0,script=no,downscript=no -device
virtio-net-pci,netdev=vnet \
-drive
file=ab21q-ubuntu-20.04-image.img,if=none,id=drive0,cache=writeback -device
virtio-blk,drive=drive0,bootindex=0 \
-drive file=ubuntu-20.04-mini.iso,if=none,id=drive1,cache=writeback
-device virtio-blk,drive=drive1,bootindex=1 \
-drive file=flash0.img,format=raw,if=pflash -drive
file=flash1.img,format=raw,if=pflash
Good thing is I can use network in the host as usual. After getting in to the
VM, I did ( by the way I changed the guest machine IP to 129.254.31.183, same
subnet)
Sudo ifconfig enp0s1 129.254.31.183/24 up
Sudo ip route add default via 129.254.31.1 dev enp0s1
I hoped I could use network in the VM, but I couldn't(can't ping or telnet to
other machine, either way).
This is the network config in the host and the guest. Just in case someone can
check and point out what’s wrong.
<< in the host : 129.254.31.181 >>
$ sudo ifconfig -a
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 129.254.31.181 netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::2efd:a1ff:fec7:1a61 prefixlen 64 scopeid 0x20<link>
ether 2c:fd:a1:c7:1a:61 txqueuelen 1000 (Ethernet)
RX packets 273494 bytes 105958971 (105.9 MB)
RX errors 0 dropped 20862 overruns 0 frame 0
TX packets 5823 bytes 4581307 (4.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp6s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 129.254.31.181 netmask 255.255.255.0 broadcast 129.254.31.255
inet6 fe80::57bd:fa67:f336:73d7 prefixlen 64 scopeid 0x20<link>
ether 2c:fd:a1:c7:1a:61 txqueuelen 1000 (Ethernet)
RX packets 356078 bytes 142521235 (142.5 MB)
RX errors 0 dropped 5450 overruns 0 frame 0
TX packets 34994 bytes 39130194 (39.1 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0x90200000-9027ffff
enp7s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 2c:fd:a1:c7:1a:60 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0x90100000-9017ffff
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1776 bytes 210444 (210.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1776 bytes 210444 (210.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
tap0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether f2:00:3e:16:6e:62 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 307 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ sudo brctl show
bridge name bridge id STP enabled interfaces
br0 8000.2cfda1c71a61 no enp6s0
tap0
<< in the guest : 129.254.31.183 >>
$sudo ifconfig -a
enp0s1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 129.254.31.183 netmask 255.255.255.0 broadcast 129.254.31.255
ether 52:54:00:12:34:56 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 307 bytes 42358 (42.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 9939 bytes 711775 (711.7 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9939 bytes 711775 (711.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
- RE: missing info in the document for qemu networking (where to find linux-test-xxx.tar.gz) (TAP networking),
ckim <=