Tag Archives: linux kickstart dhcp

Linux Kickstart without DHCP & TFTPBOOT

If you’re new to kickstart and feeling overwhelmed by the prospect of configuring a PXE boot, DHCP, and TFTP server, I’ll guide you through setting up a kickstart environment without the need for those components. It can be a straightforward process.

Kicstart is a fast way of provisioning a Linux server. Usually, in a large environment, you would opt for PXE booting which needs a DHCP server to allocate an IP, and a TFPBoot server to send the boot image (pxelinux.0).  But in a smaller environment, or when you cannot have a dhcp server,  booting from an ISO boot image and then continuing with kickstart is an option.   We will be setting up a RHEL 8 kickstart environment; however, the steps are similar for CentOS too. Let’s start…

Step 1: Download ISO images from Red Hat.
               1. RHEL8 DVD ISO; later we will be creating a local repo from this.
               2. RHEL8 Boot ISO image;  we will be using this for booting the system.

Step 2: Create a repo from the iso image and make it avaibale via http or nfs

yum install httpd
systemctl start httpd
mkdir /var/www/html/rhel86
mount rhel-8.6-x86_64-dvd.iso /var/www/html/rhel86

Now that the repo is ready, verify it from a browser.
http://ip_address_of_your_host/rhel86

Step 3: Optional. Let’s also create an additional repo for 3rd party packages.
For example, if you need to install a backup client on the server, you can create a directory, copy the RPMs into it, and then execute the ‘createrepo’ command.

yum install createrepo
mkdir /var/www/html/extpkgs
createrepo /var/www/html /extpkgs

Verify the repo.
http://ip_address_of_your_host/extpkgs

Step 4: Create the kickstart file.
Now that we have completed the repository creation, the next step is to generate the kickstart configuration file. You can utilize any of the methods listed below to create one.

  1. Use the Red Hat Kickstart Generator
  2. Do a manual OS install with the DVD ISO. Look for the file /root/anaconda.cfg.   This is your kickstart file.

I’ve attached a sample kickstart file for you to experiment with.

Step 5:  Make the kickstart file available via http.
Copy the kickstart config file (ks.cfg) to the httpd server where your repo resides and set the permission to 755. If there is no index.html file under /var/www/html, create one; otherwise, you may encounter an error.

scp ks.cfg host-ip:/var/www/html
chmod 755 /var/www/html/ks.cfg
touch /var/www/html/index.htm

Step 6: Start Installation.
At this point, we have all the necessary components to commence the installation process. Mount the Boot ISO and initiate the system’s boot process from it. You should be greeted with a screen similar to this:

Press the ESC key to get the boot prompt and then enter the anaoconda command, similar to the one below

Let’s examine the above command..

  •  linux inst.ks =http://10.33.204.15/ks.cfg    Specifies the location and name of the kickstart file. Always starts with ‘linux inst.ks’
  •  ip=172.20.60.60::172.20.60.1:24. Address 172.20.60.60 is the temporary address the server gets during the installation process. The final IP of the server is set in the kickstart config file. 172.20.60.1 is the default gateway. 24 is the netmask. I have omitted the server_id field in the above example, with 2 consecutive colons (::) .

Note:

  • If you make any mistakes in the Anaconda command, the system may be unable to fetch the kickstart config file, causing the installation to halt.
  • If there are multiple network interface cards (NICs) that are active, both will be configured with the same IP address. This can be resolved by either deleting one of the connections using the nmcli command or by configuring NIC bonding, after the installation.

Conclusion
Even if you are new to kickstart, configuring an environment is a relatively straightforward process. By avoiding the need for DHCP and TFTP boot components, we have simplified the installation process considerably.