大网数据广告活动
服务器运维问答

Kickstart creates 2 configuration files for same network interface

· 52CE 我爱测

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 foll…

问题原文

原帖链接 · miken32 · CC BY-SA 3.0

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.)

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 3.0

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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-12-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。