When I install Fedora 19 with a kickstart file and via network, the generated ifcfg-eth0 file is genorated by the kickstart:
# Generated by parse-kickstart
However if I use the same kickstart file and install via a USB stick, the ifcfg file is generated by initrd.
# Generated by dracut initrd
The line in the kickstart file to set the network settings is as follows:
network --device=eth0 --bootproto=dhcp --hostname=SOMEHOSTNAME
Is there away to keep network device settings set in the kickstart file when not installing via network?
EDIT
In the line in the kickstart file we define the network device as eth0. With the new version of Fedora (and probably other distros) the network cards are no longer referred to as eth0 or eth1, the OS uses the bios name for the card (for more info see here).
Due to scripts that are used on the machines we are building, we require the network cards to be named with the old naming convention. I know this is not a good fix for the issue, but the time investment in to fixing all the scripts we use is not feasible and outside the scope of this project.
Best Answer
I usually do it in the
%post
section of the kickstart file.for example like this
And put whatever settings you'd like in there. I usually parse MAC addr with something like
HWADDR=$(/usr/sbin/ifconfig eth0 | grep -Po '(?<=ether )([0-9a-f]{2}[:-]){5}([0-9a-f]{2})'
or something like that and add it too so it looks like this:If the case is that the device name have changed then there may be a file in
/etc/sysconfig/network-scripts/
created already by dracut. Just useip addr show
or something to find out what the OS calls your NIC, and setNAME=eth0
in the correspondingifcfg-XXX
-file. This should be simple enough to do.