Pxeboot: Client not getting ip address from the DHCP Server

5,867

The first issue is that KVM will likely use dnsmasq to provide addresses. The address ranges are configured in the network definition. It should not be necessary to install your own DHCP server.

The isc-dhcp-server is likely trying to listen on a eth0 as a default. It not unusual to have a point-to-point address on your Internet interface (usually eth0). If not it is likely using an address in the 192.168.0.0/16 address range provided by your router.

I configure my VMs using a fixed address on a bridge device which is not connected to any external interfaces. However, if you do have a router you may want to configure your KVM bridge to include the eth0.

Share:
5,867

Related videos on Youtube

Beginner
Author by

Beginner

Openstack Admin & Linux System Admin

Updated on September 18, 2022

Comments

  • Beginner
    Beginner over 1 year

    I am Working on Pxeboot. I have a Ubuntu system as KVM and in that system I installed Virtual machine manager.

    I also installed Ubuntu in the virtual machine.

    Before I start my virtual machine, I attached the Virtual network interface.

    Source device: Host device eth0:macvtap
    Device model : Hypervisor default
    Mac Address  : 00:22:11:01:22:55
    Source mode  : private
    

    I installed DHCP server in the VM:

    # apt-get install isc-dhcp-server
    

    And configured in the dhcpd.conf file:

    allow booting;
    allow bootp;
    
    filename "pxelinux.0"
    
    subnet 10.5.5.0 netmask 255.255.255.0 {
      range 10.5.5.5 10.5.5.100;
      option domain-name-servers ns1.testworld.local.net;
      option domain-name "testworld.local.net";
      option routers 10.5.5.1;
      option broadcast-address 10.5.5.254;
      default-lease-time 600;
      max-lease-time 7200;
     }
    
    host pxebootserver {
      hardware ethernet 00:22:11:01:22:55      
      fixed-address 10.5.5.1
     }
    

    When I restart the isc-dhcp-server, I got this errors in syslog:

    Jul  2 20:06:19 ubuntu dhcpd: Wrote 0 leases to leases file.
    Jul  2 20:06:19 ubuntu dhcpd: 
    Jul  2 20:06:19 ubuntu dhcpd: No subnet declaration for eth0 (no IPv4 addresses).
    Jul  2 20:06:19 ubuntu dhcpd: ** Ignoring requests on eth0.  If this is not what
    Jul  2 20:06:19 ubuntu dhcpd:    you want, please write a subnet declaration
    Jul  2 20:06:19 ubuntu dhcpd:    in your dhcpd.conf file for the network segment
    Jul  2 20:06:19 ubuntu dhcpd:    to which interface eth0 is attached. **
    Jul  2 20:06:19 ubuntu dhcpd: 
    Jul  2 20:06:19 ubuntu dhcpd: 
    Jul  2 20:06:19 ubuntu dhcpd: Not configured to listen on any interfaces!
    Jul  2 20:10:26 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9
    Jul  2 20:10:35 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 21
    Jul  2 20:10:56 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
    Jul  2 20:11:08 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 17
    Jul  2 20:11:25 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10
    Jul  2 20:11:35 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
    Jul  2 20:11:47 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
    Jul  2 20:12:03 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
    Jul  2 20:12:14 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9
    Jul  2 20:12:23 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
    Jul  2 20:12:34 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
    Jul  2 20:12:37 ubuntu dhclient: No DHCPOFFERS received.
    Jul  2 20:12:37 ubuntu dhclient: No working leases in persistent database - sleeping.
    

    Even clients cannot discover the dhcp server.

    Which virtual network adapter do I have to enable in the Client VM?

    • Momo
      Momo almost 10 years
      can you please post the output of ip addr on the dhcp server?