Hi all,
I'm confused about this.
Im playing with a kickstart file to install a 7.4 release.
If I type network config on cmdline on the iso like this:
label linux
menu label ^Install custom image [ type network config ]
menu default
kernel vmlinuz
append initrd=initrd.img inst.ks=cdrom:/ks/rhel7.ks hn=xxxx ip=1.2.3.4 netmask=255.255.255.0 gateway=1.2.3.5 ksdevice=ensf0
Later on ks file:
%pre --interpreter /bin/bash --log /tmp/ks-pre.log
echo "Interpreting any command line arguments..."
servername=$(awk -F 'hn=' '{print $2}' /proc/cmdline |cut -d ' ' -f 1)
ip=$(awk -F 'ip=' '{print $2}' /proc/cmdline |cut -d ' ' -f 1)
netmask=$(awk -F 'netmask=' '{print $2}' /proc/cmdline |cut -d ' ' -f 1)
gateway=$(awk -F 'gateway=' '{print $2}' /proc/cmdline |cut -d ' ' -f 1)
device=$(awk -F 'ksdevice=' '{print $2}' /proc/cmdline |cut -d ' ' -f 1)
echo "network --bootproto=static --ip=$ip --netmask=$netmask --gateway=$gateway --device=$device --hostname=$servername --noipv6 " > /tmp/ks-network.cfg
%end
OK, no problem, this works perfect.
But I would like to have a menu, so it asks me about config network like this:
The isolinux section would be:
label linux
menu label ^Install custom image [ with network menu ]
kernel vmlinuz
append initrd=initrd.img inst.ks=cdrom:/ks/rhel7_menu.ks
And later on %pre section:
%pre --interpreter /bin/bash --log /tmp/ks-pre.log
hostname=""
ip=""
netmask=""
gw=""
opts=""
answer="n"
device=""
curTTY=`tty`
exec < $curTTY > $curTTY 2> $curTTY
clear
while [ x"$answer" != "xy" ] && [ x"$answer" != "xY" ] ; do
echo -n "Enter hostname: "; read hostname
echo -n "Enter ip: "; read ip
echo -n "Enter netmask: "; read netmask
echo -n "Enter default gw: "; read gw
echo -n "Enter network dev: "; read device
echo
echo You entered:
echo -e "\tHostname: $hostname"
echo -e "\tIP: $ip"
echo -e "\tNetmask: $netmask"
echo -e "\tDefault gw: $gw"
echo -e "\tNetwork dev: $device"
echo -n "Is this correct? [y/n] "; read answer
done
echo "network --bootproto=static --ip=$ip --netmask=$netmask --gateway=$gw --device=$device --hostname=$hostname --noipv6 " > /tmp/ks-network.cfg
%end
This does not work.
I have my url variable pointing to my repo in both ks files:
url --url="http://172.30.97.19/provision/repo74"
But it seems this is not available if I do not type network config on cmdline...
The issue is that if I type config network on cmdline of the isolinux boot, it works, but indeed, the network gets configured on %pre section, isnt it?
So, why this dont work in "interactive mode" if I get the network configured on %pre section on both ??
Thanks guys.
Regards,
Mariano.
Config network on %pre section with menu
Issues related to configuring your network
Return to “CentOS 7 - Networking Support”
Jump to
- CentOS General Purpose
- ↳ CentOS - FAQ & Readme First
- ↳ Announcements
- ↳ CentOS Social
- ↳ User Comments
- ↳ Website Problems
- CentOS 8 / 8-Stream / 9-Stream
- ↳ 8 /8-Stream / 9-Stream - General Support
- ↳ 8 /8-Stream / 9-Stream - Hardware Support
- ↳ 8 /8-Stream / 9-Stream - Networking Support
- ↳ 8 /8-Stream / 9-Stream - Security Support
- CentOS 7
- ↳ CentOS 7 - General Support
- ↳ CentOS 7 - Software Support
- ↳ CentOS 7 - Hardware Support
- ↳ CentOS 7 - Networking Support
- ↳ CentOS 7 - Security Support
- CentOS Legacy Versions
- ↳ CentOS 5
- ↳ CentOS 5 - General Support
- ↳ CentOS 5 - Software Support
- ↳ CentOS 5 - Hardware Support
- ↳ CentOS 5 - Networking Support
- ↳ CentOS 5 - Server Support
- ↳ CentOS 5 - Security Support
- ↳ CentOS 5 - Oracle Installation and Support
- ↳ CentOS 5 - Miscellaneous Questions
- ↳ CentOS 6
- ↳ CentOS 6 - General Support
- ↳ CentOS 6 - Software Support
- ↳ CentOS 6 - Hardware Support
- ↳ CentOS 6 - Networking Support
- ↳ CentOS 6 - Security Support