Sample Header Ad - 728x90

pxeboot with dnsmasq as dhcp proxy for rockylinux

0 votes
0 answers
77 views
first, I installed apache & started its service
yum install httpd && systemctl enabled httpd --now
then I mounted dvd iso & copied its content to apache dir
mount -o ro ~/Downloads/rockylinux9.iso /mnt/iso

cp -rv /mnt/iso/* /var/www/html/install-media/
and copied kickstart file under
cp ~/kickstart-rockylinux9.cfg /var/www/html/install-media/kickstart/
then I installed tftp-server & syslinux & started tftp-server
yum install tftp-server syslinux
then I created these dirs & copied kernel files to below path
mkdir -p /var/lib/tftpboot/{images,pxelinux.cfg}

cp /var/www/html/install-media/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/images/
then I copied menu files from syslinux dir
cp /usr/share/syslinux/{menu.c32,pxelinux.0} /var/lib/tftpboot/
finally created menu file /var/lib/tftpboot/pxelinux.cfg/default with below content
default menu.c32
prompt 0
timeout 300
ontimeout 2

menu title PXE Boot Menu
label 1
  menu label ^1 - Install Rocky Linux 9
  kernel images/vmlinuz
  append initrd=images/initrd.img showopts method=http://192.168.1.254/install-media/  devfs=nomount ks=http://192.168.1.254/install-media/kickstart/kickstart-rockylinux9.cfg 
Now the critical part is dnsmasq.conf, as my physical host is on bridged network with kvm installed on it. so dnsmasq is supposed to proxy dhcp request to my router
# cat /etc/dnsmasq.con

# Enable proxy DHCP for PXE
port=0
dhcp-range=192.168.1.0,proxy
# Specify PXE options
dhcp-boot=pxelinux.0,,192.168.1.254
enable-tftp
tftp-root=/var/lib/tftpboot
here's my kickstart file
# Generated by Anaconda 34.25.5.9
# Generated by pykickstart v3.32
#version=RHEL9
# Use graphical install
graphical

# Remove CDROM installation media line
# cdrom

# Specify the HTTP repository
repo --name="AppStream" --baseurl=http://192.168.1.254/install-media/ 

%addon com_redhat_kdump --disable
%end

# Keyboard layouts
keyboard --xlayouts='us'

# System language
lang en_US.UTF-8

# Network information
network --bootproto=dhcp --device=enp1s0 --noipv6 --activate
network --hostname=ks-sample2

# Packages to install
%packages
@^minimal-environment
%end

# Firstboot configuration
firstboot --enable

# Disk and partition configuration
ignoredisk --only-use=vda
clearpart --none --initlabel
part /boot --fstype="xfs" --ondisk=vda --size=1024
part pv.50 --fstype="lvmpv" --ondisk=vda --size=70655
volgroup rl --pesize=4096 pv.50
logvol swap --fstype="swap" --size=7167 --name=swap --vgname=rl
logvol / --fstype="xfs" --size=63484 --name=root --vgname=rl
I am unable to boot, after getting IP info properly from dhcp it says, No boot devices found. enter image description here
Asked by Sollosa (1993 rep)
Jan 21, 2025, 07:42 AM