Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Issues with Bridged Networking and KVM

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
RKarim
Posts: 1
Joined: 2021-10-14 18:56

Issues with Bridged Networking and KVM

#1 Post by RKarim »

Hello,

I am attempting to set up a few VMs on my Debian machine using Libvirt and KVM. I would like these VMs to have their own public IP addresses, and if my understanding is correct, the way to accomplish this is via bridged networking. I have a /29 from my dedicated server provider. The following is my /etc/network/interfaces file.

Code: Select all


source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

iface eno1 inet manual

auto br0
iface br0 inet static
    # Use the MAC address identified above.
    hwaddress ether 00:25:90:d2:ae:1c
    address {MY HOSTS IP}
    netmask {CORRESPONDING NETMASK}
    gateway {CORRESPONDING GATEWAY}

    bridge_ports eno1
    # If you want to turn on Spanning Tree Protocol, ask your hosting
    # provider first as it may conflict with their network.
    bridge_stp off
    # If STP is off, set to 0. If STP is on, set to 2 (or greater).
    bridge_fd 0

This bridge appears to work, and in fact it does for the first VM I setup. I am setting up VMs using virt-install. This is the command I use:

Code: Select all

sudo virt-install --name {NAME} --ram {RAM} --vcpus 8 --disk path=/var/lib/libvirt/images/{DISK NAME},size=64 --os-type linux --os-variant debian9 --network bridge=br0 --graphics vnc,listen=0.0.0.0 --console pty,target_type=serial --location 'http://ftp.debian.org/debian/dists/bullseye/main/installer-amd64/'
I can successfully install Debian on exactly one VM with their own public IP. After that, no other VMs that I set up can connect to the internet. There is obviously something wrong with my configuration but I'm having difficulty finding the problem. Guidance would be greatly appreciated.

Thanks.
RK

CwF
Global Moderator
Global Moderator
Posts: 2625
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 190 times

Re: Issues with Bridged Networking and KVM

#2 Post by CwF »

If you can use macvtap,
from virt-install man
--network OPTIONS
type=direct,source=IFACE[,source_mode=MODE]
Direct connect to host interface IFACE using macvtap.
if not migrating vm's, this should be simpler.

Post Reply