1

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:

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

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 192.168.130.10 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.