You are not logged in.

#1 2025-12-06 18:23:59

0plovyk
Member
Registered: 2025-10-22
Posts: 9

How to setup isolated VLAN in virtual machine (KVM/QEMU)

I want to isolate my VM network from my main PC network. I am using libvirt and VMM. Already will thank everyone who will respond.

Last edited by 0plovyk (2025-12-07 03:51:51)

Offline

#2 2025-12-07 11:43:52

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,951

Re: How to setup isolated VLAN in virtual machine (KVM/QEMU)

Does the VM need access to the outside world ?

Please post the output of

$ ip link
$ ip address

Also the contents of the domain file for your VM would be helpful. It's probably found in $HOME/.config/libvirt/qemu/ .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2025-12-12 20:52:09

0plovyk
Member
Registered: 2025-10-22
Posts: 9

Re: How to setup isolated VLAN in virtual machine (KVM/QEMU)

Thanks you and sorry for making wait so long. Inside VM i hace this responds:

ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 52:54:00:6e:e0:ee brd ff:ff:ff:ff:ff:ff
    altname enx5254006ee0ee
ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:6e:e0:ee brd ff:ff:ff:ff:ff:ff
    altname enx5254006ee0ee
    inet 192.168.122.123/24 brd 192.168.122.255 scope global dynamic noprefixroute enp1s0
       valid_lft 3261sec preferred_lft 3261sec
    inet6 fe80::3e2d:2094:514b:4f0c/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

i have only empty folders (checkpoint, dump, lib ...) in qemu/ directory

Offline

#4 2025-12-13 12:02:05

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,951

Re: How to setup isolated VLAN in virtual machine (KVM/QEMU)

That indicates we can focus on ipv4 as the ipv6 addresses the guest has are not routable (they do offer some local functionality) and have no connection to other networks .

On the host run (and post the output of)

$ ip address
$ ip route

i have only empty folders (checkpoint, dump, lib ...) in qemu/ directory

How do you start the VM ?

Last edited by Lone_Wolf (2025-12-13 12:02:58)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB