Prior to Centos 7 if we wanted to have a manual network configuration while setting up a VM or Baremetal system all we had to do was to add ‘askNetwork’ command in the Kickstart file.
When the installer reached the network configuration part it would automatically halt and let the user configure the network through a UI.
Moving forward to Centos 7 this option has been deprecated. To cater this problem our team wrote a script that takes the network details as input as part of Kickstart file’s Post installation script.
The workaround that we ended up implementing is that we write the network script by taking the input from the user and when the machine boots up we replace/update the existing network script. The replacement/update is achieved by running another script which is scheduled to on boot using cron entry.
Usage:
The file asknetwork-script.sh
contains a post script that can be added in the kickstart file. At the end of the installation, this script prompts the user if he/she wants to manually configure static network for the VM/server. If the user opts in, the user has to provide all the network details. The script generates a network script that is used to configure the network.
After you have added the postscript. You need to add a crontab entry for starting the configure-manual-network.sh
script. This script is essential as its the one that actually takes the network script file generated by the Kickstart post script and configures the network.