Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Is one of them wrong? –  Michael Hampton Nov 4 '13 at 21:08
    
Sorry yes, I will edit the post. –  dooffas Nov 5 '13 at 9:43

1 Answer 1

I usually do it in the %post section of the kickstart file.

for example like this

cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOM
TYPE=Ethernet
BOOTPROTO=dhcp
NAME=eth0
ONBOOT=yes
EOM

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:

cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOM
HWADDR=$HWADDR
TYPE=Ethernet
BOOTPROTO=dhcp
NAME=eth0
ONBOOT=yes
EOM

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 use ip addr show or something to find out what the OS calls your NIC, and set NAME=eth0 in the corresponding ifcfg-XXX-file. This should be simple enough to do.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.