How to configure DHCP server in Virtualbox CentOS7 VM for Cobbler PXE boot?
0
votes
1
answer
1394
views
I am very new to Virtual Box and try to emulate cobber PXE boot network installation in virtual box
Trying to configure VM1 as PXE/DHCP server and make VM2 as client to get the IP from VM1 DHCP server on network boot for network installation.
But keep on getting IP from host machine where virtual box installed. because of that VM2 could not find the pxeboot files that is present in the VM1.
**VM1 dhcp status snippet:**
Listening on LPF/enp0s3/08:00:27:86:b1:c6/192.168.43.0/24
Aug 09 19:03:23 localhost.localdomain dhcpd: Sending on LPF/enp0s3/08:00:27:86:b1:c6/192.168.43.0/24
Aug 09 19:03:23 localhost.localdomain dhcpd: Sending on Socket/fallback/fallback-net
Aug 09 19:03:23 localhost.localdomain systemd[1] : Started DHCPv4 Server Daemon.
**VM1 dhcp conf file**
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
option pxe-system-type code 93 = unsigned integer 16;
subnet 192.168.43.0 netmask 255.255.255.0 {
option routers 192.168.43.1;
option domain-name-servers 192.168.43.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.43.100 192.168.43.254;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.43.146;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
if option pxe-system-type = 00:02 {
filename "ia64/elilo.efi";
} else if option pxe-system-type = 00:06 {
filename "grub/grub-x86.efi";
} else if option pxe-system-type = 00:07 {
filename "grub/grub-x86_64.efi";
} else if option pxe-system-type = 00:09 {
filename "grub/grub-x86_64.efi";
} else {
filename "pxelinux.0";
}
}
}
# group for Cobbler DHCP tag: default
group {
host centostest.mydomain.com-net0 {
hardware ethernet 08:00:27:7f:aa:f1;
fixed-address 192.168.43.120;
option host-name "centostest.mydomain.com";
option subnet-mask 255.255.255.0;
option routers 192.168.43.1;
filename "/pxelinux.0";
next-server 192.168.43.146;
}
}
**VM1 adapter setting - server**
**VM2 Adapter setting - client**
**Upon network boot of VM2, it gets IP 192.168.43.17 instead of 192.168.43.120 as provided in the vm1 dhcp conf file**
How to fix this issue?



Asked by Mohan
(143 rep)
Aug 9, 2019, 02:03 PM
Last activity: Sep 18, 2019, 11:29 AM
Last activity: Sep 18, 2019, 11:29 AM