1

Trying my first Kickstart with Scientific Linux 7, and have ironed out most of the bugs with migrating my scripts from SL6, but one remains.

I boot the VM on DHCP to pull the Kickstart file from an HTTP server, by adding the following at the boot loader prompt:

net.ifnames=0 ip=eth1:dhcp inst.ks=http://server/ks.cfg

This works fine, and the file is downloaded and processed successfully.

Kickstart config:

…
network --bootproto=static --device=eth0 --ip=192.168.242.224 --netmask=255.255.255.0 --gateway 192.168.242.1 --nameserver 192.168.242.200
network --bootproto=static --device=eth1 --ip=10.10.242.224 --netmask=255.255.255.0 --nodns
…

After installation and reboot, eth1 is fine. However, eth0 stays on DHCP. Checking in /etc/sysconfig/network-scripts/ I find both ifcfg-eth0 with the static IP information, but also ifcfg-eth0-1 with a DHCP config.

/etc/sysconfig/network-scripts/ifcfg-eth0

# Generated by parse-kickstart
UUID=9db01644-e98d-4260-a13e-96d26b251297
DNS1=192.168.242.200
IPADDR=192.168.242.224
GATEWAY=192.168.242.1
DEFROUTE=yes
IPV6_AUTOCONF=no
NETMASK=255.255.255.0
BOOTPROTO=static
DEVICE=eth0
ONBOOT=no
IPV6INIT=yes

/etc/sysconfig/network-scripts/ifcfg-eth0-1

HWADDR=00:50:56:93:D0:AA
TYPE=Ethernet
BOOTPROTO=dhcp
DNS1=192.168.242.200
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV4_ROUTE_METRIC=0
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=73ef022d-ff28-404e-9326-cb2240ba78c1
DEVICE=eth0
ONBOOT=yes

It appears the second configuration is taking precedence; what can I do to prevent this behaviour?

(If it's relevant, I've disabled "consistent" interface names because they are anything but on virtual hardware. I specify net.ifnames=0 on the boot loader and then remove the biosdevname package in my Kickstart.)

miken32
  • 942
  • 1
  • 13
  • 35
  • Even virtual hardware can be predictable, but it's dependent on your hypervisor to not screw this up. Guests on VMware ESXi, for instance, come up with some really bizarre "consistent" network device names. But with consistent disabled, eth0 and eth1 may switch arbitrarily. That it hasn't happened to you _yet_ doesn't mean it won't. – Michael Hampton Dec 21 '16 at 00:10
  • Yeah I'm on ESXi and got names like eno196380. I know there's a risk, but I've created about 300 VMs over the past 4 years with SL6 Kickstarts, so I'm not _too_ worried about eth0/eth1 switching around on me! – miken32 Dec 21 '16 at 00:19

1 Answers1

1

When you give a boot command line option to start networking to load a kickstart file over the network, the corresponding network line in the kickstart needs the --activate option added.

From the documentation:

--activate - activate this device in the installation environment.

If you use the --activate option on a device that has already been activated (for example, an interface you configured with boot options so that the system could retrieve the Kickstart file) the device is reactivated to use the details specified in the Kickstart file.

This would look something like:

network --bootproto=static --device=eth1 --ip=10.10.242.224 --netmask=255.255.255.0 --nodns --activate
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972