ifcfg-eth0 vs ifcfg-eth0-1 Files

Issues related to configuring your network
Post Reply
trinkel
Posts: 10
Joined: 2013/01/07 17:48:37
Contact:

ifcfg-eth0 vs ifcfg-eth0-1 Files

Post by trinkel » 2018/01/10 17:19:54

Disclaimer: I did try searching this and didn't find a direct answer. Sorry if I just missed it.

I have a new CentOS 7.4 install as a guest on a CentOS 6.9 Xen 4.6.6 host. It was installed with virt-install:

Code: Select all

virt-install --paravirt --name dns-1 --ram 2048 --vcpus 2 --disk path=/dev/vg_xxx/lv_xxx --network bridge=xenbr0 --location http://vault.centos.org/7.3.1611/os/x86_64/ --graphics none --initrd-inject=/root/Xen/Kickstarts/centos7.3_vm180105.01.ks --extra-args "ks=file:/centos7.3_vm180105.01.ks"
Networking was set up in the kickstart file:

Code: Select all

network --device=eth0 --bootproto=static --ip=xx.xx.xx.179 --netmask=255.255.255.0 --gateway=xx.xx.xx.115 --nameserver=xx.xx.xx.180,xx.xx.xx.181,208.67.222.222,208.67.200.200 --ipv6 auto --hostname=host.domain.com --onboot=yes
There were some oddities in the actual install process which I am leaving out to simplify matters (but can include later if necessary) in the hope that this will be a simple answer.

Looking in /etc/sysconfig/network-scripts, there are two config files: ifcfg-eth0 and ifcfg-eth0-1. I know that ifcfg-eth0:1 would be for a virtual IP. Is the "-1" a backup that a script created at some point (I haven't edited anything yet) or is it actually used by the system. Both files have the same IP address.

Here are the redacted file contents for reference:
ifcfg-eth0

Code: Select all

# Generated by dracut initrd
NAME="eth0"
HWADDR="00:16:3e:85:cf:20"
ONBOOT=yes
NETBOOT=yes
UUID="103241a0-6d18-4a31-9646-38756cffebcb"
IPV6INIT=yes
BOOTPROTO=none
IPADDR="xx.xx.xx.179"
NETMASK="255.255.255.0"
GATEWAY="xx.xx.xx.115"
TYPE=Ethernet
DNS1="xx.xx.xx.180"
DNS2="xx.xx.xx.181"
DNS3="208.67.222.222"
DNS4="208.67.200.200"
ifcfg-eth0-1

Code: Select all

TYPE="Ethernet"
BOOTPROTO="none"
IPADDR="xx.xx.xx.179"
PREFIX="24"
GATEWAY="xx.xx.xx.115"
DNS1="xx.xx.xx.180"
DNS2="xx.xx.xx.181"
DNS3="208.67.222.222"
DNS4="208.67.200.200"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="eth0"
UUID="02bfb71c-4240-403e-b822-25cedb366c00"
DEVICE="eth0"
ONBOOT="yes"
Thanks!

User avatar
TrevorH
Forum Moderator
Posts: 23879
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: ifcfg-eth0 vs ifcfg-eth0-1 Files

Post by TrevorH » 2018/01/10 18:09:00

Just looks like a duplicate to me. What does `nmcli c sh` say?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

trinkel
Posts: 10
Joined: 2013/01/07 17:48:37
Contact:

Re: ifcfg-eth0 vs ifcfg-eth0-1 Files

Post by trinkel » 2018/01/10 19:16:28

Code: Select all

NAME    UUID                                  TYPE            DEVICE 
eth0    02bfb71c-4240-403e-b822-25cedb366c00  802-3-ethernet  eth0   
virbr0  c6fd9d41-1d94-42cb-adcd-ecf81810f578  bridge          virbr0 
eth0    103241a0-6d18-4a31-9646-38756cffebcb  802-3-ethernet  --
Second and third lines are green. First and fourth black.

If –1 is a copy, would the network command from the kickstart have created it?

User avatar
TrevorH
Forum Moderator
Posts: 23879
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: ifcfg-eth0 vs ifcfg-eth0-1 Files

Post by TrevorH » 2018/01/10 20:45:41

I guess you can use the uuid from that to delete the unused ifcfg file.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

trinkel
Posts: 10
Joined: 2013/01/07 17:48:37
Contact:

Re: ifcfg-eth0 vs ifcfg-eth0-1 Files

Post by trinkel » 2018/01/10 20:53:47

That would be the one on the last line, right?

User avatar
TrevorH
Forum Moderator
Posts: 23879
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: ifcfg-eth0 vs ifcfg-eth0-1 Files

Post by TrevorH » 2018/01/10 22:05:42

eth0 02bfb71c-4240-403e-b822-25cedb366c00 802-3-ethernet eth0
Appears to be up and running, the one with uuid 103241a0-6d18-4a31-9646-38756cffebcb is not (it seems).

I'd rename the file or move it away rather than delete it so that if anything breaks you can put it back.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

trinkel
Posts: 10
Joined: 2013/01/07 17:48:37
Contact:

Re: ifcfg-eth0 vs ifcfg-eth0-1 Files

Post by trinkel » 2018/01/10 22:12:48

Sound like a plan. Thanks!

huawei-song
Posts: 1
Joined: 2018/08/31 08:56:37

Re: ifcfg-eth0 vs ifcfg-eth0-1 Files

Post by huawei-song » 2018/08/31 09:02:11

I also encountered the same problem.
But I want to know who created this file?
Any ideas?

Post Reply