Score:0

Get network access from my virtual machine with qemu and Debian Host

cu flag

I have a (hopefully) simple problem.

I try to configure my host system to route network traffic through one physical network interface.

Here is my setup:

I have an ethernet interface (eth0) and i have a bridge already running. Important to this setup is. I had to switch the Mac-Adress because the hoster seems to only allow traffic on the main Mac-Address. So.

This is my interfaces config for br0 and eth0:

auto br0 eth0

iface eth0 inet manual
    hwaddress ether 9e:91:af:f2:79:ef

iface eth0 inet6 manual
    hwaddress ether 9e:91:af:f2:79:ef

iface br0 inet static
    address 89.58.62.11/22
    gateway 89.58.60.1
    hwaddress ether 0a:a2:e9:ed:76:99
    bridge_ports eth0
    bridge_stp off
    bridge_maxwait 0
    bridge_fd 0

iface br0 inet6 static
    address 2a0a:4cc0:1:242::1
    gateway fe80::1
    hwaddress ether 0a:a2:e9:ed:76:99
    bridge_ports eth0
    bridge_stp off
    bridge_maxwait 0
    bridge_fd 0

As you can see i configure br0 to use ipv4 and ipv6 and eth0 (the physical interface) is just added to the bridge br0.

Now i want an VM with a second physical IPv4 (official IPv4) and hopefully an IPv6 from my net.

I run the guest in an qemu instance with these starting conditions (currently):

#!/bin/sh
qemu-system-x86_64 -machine type=pc-q35-2.12,accel=tcg -smp 6 -m size=4G,slots=2,maxmem=12G -k de -device virtio-net-pci,netdev=net0 -netdev tap,id=net0,"helper=/usr/lib/qemu/qemu-bridge-helper" -device qemu-xhci -spice port=5900,password=mysecretpw -vga qxl -drive file=hda.img,if=virtio,bus=0,unit=0,media=disk,cache=writeback -drive file=/opt/cdimages/debian-11.5.0-amd64-netinst.iso,media=cdrom,index=0 -drive file=/opt/cdimages/virtio-drivers.iso,media=cdrom,index=1

Additional: My routing table on the host

Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
0.0.0.0         89.58.60.1      0.0.0.0         UG    0      0        0 br0
89.58.60.0      0.0.0.0         255.255.252.0   U     0      0        0 br0

And now its up to you. Can anyone help me to get my guest running with my second official IP:

89.58.20.44/32

Oh. Btw. My Host-System is a Debian 11 Server.

If it is important: The host system is a "root"-server which means it is also a vm with physical attached hardware. But i have access to everything on the host like a dedicated server.

I hope someone can help me.

Greetings

Christian Nill

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.