0

I set up a DHCP server in a KVM Guest inside a CentOS7 box. What I want is this DHCP Server to provide addresses to all other installed VMs and, if possible, the main host as well.

  • The network used by all VMs is a custom conf bridged network.
  • The main box has two physical interfaces one that I use to connect to and the other one is now being used as the interface for the bridge-slave connection
  • I configured virsh to use the bridged network as the default network and turned off the NAT
  • I have a second VM to test if the DHCP is actually handing out a fixed address, no luck so far.
  • The bridge interface created in the main host does not have a fixed ip address and the bridge-slave connection has the ethernet physical interface attached.

ifconfig for br0 (bridge for box)

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.104  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::242e:9f2e:c1ee:1123  prefixlen 64  scopeid 0x20<link>
        ether 70:40:r6:54:5c:7a  txqueuelen 1000  (Ethernet)

DHCP File:

# global options

option domain-name "homelab.net";
option domain-name-servers 8.8.8.8,8.8.4.4;
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;

subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.2 192.168.1.254;
    option broadcast-address 192.168.1.255;
    option routers 192.168.1.1;
    next-server 192.168.1.111;
    filename "pxelinux.0";
}
host webservers {
    hardware ethernet 54:54:00:38:54:33;
    fixed-address 192.168.1.150;
}

I know that the external router dhcp is still provisioning of addresses to both the main host and the guests, and also having the same subnet, 192.168.1.0/24 that I what I intend to modify. To get rid of the external dhcp router.

Leo
  • 1
  • 1
  • `if possible, the main host as well.` That sounds like a chicken and egg problem. Also, don't configure anything via DHCP that creates a problem if the DHCP server is down. – Sven Apr 20 '18 at 14:04
  • No connection problems when the dhcp server is down. I sort of figured out that the main host was not going to be included. But what do I do to make the other vms request ips to the dhcp server in the vm ? – Leo Apr 20 '18 at 14:19

0 Answers0