1

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.

2
  • 1
    Is one of them wrong? Nov 4, 2013 at 21:08
  • Sorry yes, I will edit the post.
    – dooffas
    Nov 5, 2013 at 9:43

2 Answers 2

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.

1

I think you should add the option net.ifnames=0 kernel command in file isolinux.cfg, the option will set your network interface to ifcfg-ethX intead of ifcfg-enX.

network --device eth0 --bootproto dhcp --ipv6 xxxxx::10/64 --gateway xxxxx:1 --nameserver --hostname foo.example.com

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .