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.