VM host network setup: IP-o.k. but no DNS or default route problem

Issues related to configuring your network
Post Reply
rita21
Posts: 3
Joined: 2021/12/26 20:18:18

VM host network setup: IP-o.k. but no DNS or default route problem

Post by rita21 » 2021/12/26 20:57:32

Hi All,

I am quite fresh in Linux and try to practice.
I work on a hp laptop, with a wireless connection (Intel Wi-Fi 6 AX201 4.18). On the physical machine a Centos8.5 is installed, working fine on wifi.
I try to set up a network between 2 clients in the VM Manager and by installing a host, the network setup provides the following:
IP Address in ipv6 format, no DNS, no default route.

The Network source is set to wlp...:macvtap and Bridge, like in the host OS.
If I type ip addr, my enpls0 doesn't have a normal inet line, only the ipv6 address. What am I missing here? Shouldn't this be working on wlan too?

Thanks for any help in advance (sorry, if it was asked before, I haven't found it then)

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: VM host network setup: IP-o.k. but no DNS or default route problem

Post by jlehtone » 2021/12/27 11:12:23

You have CentOS Linux 8.5 (which will EOL this week) as host and run libvirt/KVM as hypervisor?

The default installation of libvirt does define virtual network named "default".
If you attach VM guest into network "default", then these will happen:
  • The host will provide DHCP and DNS servers for the "default"
  • The VM guests can get network config from the host. The host will be the gateway for them
  • The VM guests will be on same subnet and see each other
  • The host will route between "default" and external physical network
  • The host will masquerade traffic that comes from "default" to external physical network
I have never used macvtap or wireless.

The libvirt supports two additional virtual networks in addition to the "routed with NAT":
* isolated: host will not route. Guests will see only other guests in the same network
* routed: there is no masquerade and machines outside need a static route "via host" to reach the guests

Additionally, libvirt can bridge, act as switch between outside and guests. Guests on bridge are on the outside's subnet.

The macvtap, etc, presumably attach the physical network device of host to a guest. I have no idea whether such device can be used simultaneously by multiple machines. (Well, there are SR-IOV and such for some fancy stuff.)

rita21
Posts: 3
Joined: 2021/12/26 20:18:18

Re: VM host network setup: IP-o.k. but no DNS or default route problem

Post by rita21 » 2021/12/27 14:40:20

Yes, I do.
Thank you very much for your explanation:)

I need macvtap and bridged connection for remote access practice.
By ip addr, the whole inet block is missing. I only got internet on the kvm hosts, when I change to NAT or create a wlp0s20f3 network, but I would need inet with bridge source mode and 'Host device wlp0s20f3:macvtap'.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: VM host network setup: IP-o.k. but no DNS or default route problem

Post by jlehtone » 2021/12/27 15:29:10

Remote access to machine that is hidden behind router that does (S)NAT, like access to a machine at your home, is possible with port forwarding. Granted, that is a different exercise, because there you need to get the firewall of the host to DNAT and allow incoming traffic. Used to be mind-boggling, as both firewalld.service and libvirtd.service are usually involved.

Bridged ... is actually what I use almost everywhere. While libvirt supposedly can create bridged, I don't let it.
What I do, is define the bridge on the host with NetworkManager (libvirt might not even be installed yet).
If the host does not have additional network devices (usually doesn't), then the host's IP config will be on the bridge.
The network device (your wlan) is enslaved to the bridge. The bridge is "a switch" and every enslaved NIC is a "port" on that switch.
The ports do not have network config. When you connect VM to such bridge, then host sees it as an additional port.
The VM, being in member of the physical subnet outside the host machine via switch, gets appropriate IP config.

However, I have no idea whether wlan can be enslaved to a bridge.

rita21
Posts: 3
Joined: 2021/12/26 20:18:18

Re: VM host network setup: IP-o.k. but no DNS or default route problem

Post by rita21 » 2021/12/28 14:00:37

As I finally got a LAN adapter to my laptop, it works on LAN perfect.
So my assumption is, my wlan-adapter can't handle the macvtap requirements.
So far so good, thanks for the support :)

Post Reply