Is there a mechanism built-in to CentOS 7 to configure network interfaces with the classic network scripts, while allowing for wildcards in the device name?Something along the lines of:/etc/sysconfig/network-scripts/ifcfg-*... would apply to every detected device.The use case here is that I'm building a CentOS 7 image which will be used on various hardware. Some hardware has multiple NICs, others a single NIC. Therefore, when the image boots for the first time, any pre-configured scripts in /etc/sysconfig/network-scripts/ don't necessarily match the current device names.The actual ifcfg script and network isn't exotic, it's a simple IPv4/DHCP network.A couple things I'm trying to avoid (if possible):NetworkManager.Changing the default interface names from udev.Pre-configuration is the main goal here. Thanks!
CentOS 7 - Wildcard interface scripts?
centos;network interface
I don't think there's any wildcard method of doing it but potentially you could have a init script or systemd unit that runs before network initialization that looks in /sys/class//net (or does an ip link) and for each interface found could create (if missing) the necessary ifcfg- file.Something like#!/bin/bashcreate_dev(){  dev=$1  echo IPV6INIT=yes  echo IPV6_AUTOCONF=yes  echo BOOTPROTO=dhcp  echo DEVICE=$dev  echo ONBOOT=yes}for dev in *do  CFG=/etc/sysconfig/network-scripts/ifcfg-$dev  if [ ! -e $CFG ]  then    create_dev $dev > $CFG  fidonemight be sufficient for the wrapper.  You just then need to create the necessary unit or init script to ensure it runs early enough in the boot process.