Fedora 30 Workstation Host, Fedora 30 Server (netinstall) Guests. I am not an expert in all this super-crazy Linux networking stuff and reading a ton of materials there and there. So I have libvirt virtual network interface:

  <forward mode='nat'>
      <port start='1024' end='65535'/>
  <bridge name='virbr-ocpc' stp='on' delay='0'/>
  <mac address='52:54:00:2c:01:00'/>
  <domain name='ocp.domain.local' localOnly='no'/>
    <forwarder addr=''/>
  <ip address='' netmask=''>
      <range start='' end=''/>
      <host mac='52:54:00:2c:01:10' name='lb-1.ocp.domain.local' ip=''/>
      <host mac='52:54:00:2c:01:11' name='bootstrap.ocp.domain.local' ip=''/>
      <host mac='52:54:00:2c:01:12' name='master-1.ocp.domain.local' ip=''/>
      <host mac='52:54:00:2c:01:13' name='worker-1.ocp.domain.local' ip=''/>

but when i create new VMs and assign correct MAC address to network interface (manually or in kickstart --mac 52:54:00:2c:01:10 \), hostname assigned to that MAC address is no set for VM. But if I understood right from libvirt documentation - it should be assigned. Is it related to <dns><forwarder ardr...>? In my case is a address of DNSmasq VM which uses separate NAT bridge. Sure, I can assign hostname in kickstart file network --hostname=lb-1.ocp.domain.local, but i want to understand, how this <host name...> thing works. IP address for VM is assigned correctly.

  • What Linux distribution is your guest running? Did you install anything on it that might set the hostname? – Michael Hampton Jul 21 at 17:39
  • Hi. I added distros. Sorry. My fault. I did not install anything on those guests. They are just blank OSes. But i imagine, that hostname should be picked automatically (mby im wrong in my assumptions). I am using regular netinstall versions. In cloud versions there is this thing called preserve_hostname: true but not sure is it somehow related there. – Dzintars Jul 21 at 19:37
  • I found similar Q. - serverfault.com/questions/778218/… And by reading libvirt.org/formatnetwork.html#elementsAddress about <dhcp> -> <host> element and especially ipv6 section it turns out that name attribute is used to match the name of launched VM because "since a MAC address has no defined meaning in IPv6". So... it could mean that in ipv4 name attribute is more like optional or probably could be used to assign IP to VM instead of mac. Basically there is no relation between name attribute and VMs hostname. – Dzintars Jul 22 at 22:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.