Sub-interface already in use on another host - brand new interface
Solution 1
This message is generated either by /etc/sysconfig/network-scripts/ifup-eth
or /etc/sysconfig/network-scripts/ifup-aliases
which process ifcfg-ethX
configuration files to configure network interfaces.
When you check the scripts more carefully you will find out that this error appears after arping
command which is trying to find out if the IP addresses specified in ifcfg-ethX
files are unique in the network.
The scripts try to avoid of duplicate configurations in the network. Ifconfig
doesn't care, it just add IP address to the interface. Check your configuration files twice as there may be some IP address twice.
Finally, it's worth to mention that you can put ARPCHECK=no
directive to ifcfg-ethX
file to disable this check.
Solution 2
I worked this out after reading dsmsk80 answer and looking in the ifup-eth script. The key line is this:
/sbin/arping -c 2 -w 3 -D -I <INTERFACE> <VLAN>
So for the OP example:
/sbin/arping -c 2 -w 3 -D -I eth0:1 192.168.0.2
Something I used this on recently returned this:
> /sbin/arping -c 2 -w 3 -D -I eth0.1508 192.168.8.1
ARPING 192.168.8.1 from 0.0.0.0 eth0.1508
Unicast reply from 192.168.8.1 [00:1C:C4:A1:D8:39] 0.605ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)
I could then take this MAC (00:1C:C4:A1:D8:39) and look it up on the dynamic addresses section of my switch. This in turn told me the VLAN and port numbers of the interface that already used that IP.
Related videos on Youtube
![FilBot3](https://i.stack.imgur.com/VGBK2.jpg?s=256&g=1)
FilBot3
I'm a DevOps Engineer with a background in Systems Engineering, education in Network Engineering and hobby in Development. I like to use Ruby, Golang, Python, and C#. I also do a little Vimscript.
Updated on September 18, 2022Comments
-
FilBot3 almost 2 years
I created a sub-interface on a RHEL box,
eth0:1
, and copied theeth0
config and changed all the settings to reflecteth0:1
and the IP address. However, when I issueifup eth0:1
I receive this error:[root@server-1 ~]# ifup eth0:1 Error, some other host already uses address 192.168.0.2. [root@server-1 ~]# ping -c 1 192.168.0.2 PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data. --- 192.168.0.2 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 10000ms
However, when I issue:
ifconfig eth0:1 192.168.0.2 up
the command works and no errors. I would use the later command, but when I use it, it interferes with my primary,eth0
, interface, and messes up the routing of my DNS traffic because its on the same subnet as the sub-interfaceeth0:1
. I will make another post about the DNS issue.These are the configs of the interfaces
[root@server-1 network-scripts]# cat ifcfg-eth0 DEVICE="eth0" BOOTPROTO="static" HWADDR="00:50:56:AF:0C:06" IPADDR="192.168.0.1" IPV6INIT="yes" NETMASK="255.255.255.0" ONBOOT="yes" TYPE="Ethernet" DNS1="192.168.2.10" DNS2="192.168.3.10" [root@server-1 network-scripts]# cat ifcfg-eth0:1 DEVICE="eth0:1" BOOTPROTO="static" HWADDR="00:50:56:AF:0C:06" IPADDR="192.168.0.2" IPV6INIT="yes" NETMASK="255.255.255.0" ONBOOT="no" TYPE="Ethernet" DNS1="192.168.2.10" DNS2="192.168.3.10"
ip addr show
[root@server-1 network-scripts]# ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:50:56:AF:0c:06 brd ff:ff:ff:ff:ff:ff inet 192.168.0.1/24 brd 192.168.0..255 scope global eth0 inet 192.168.2.1/30 brd 192.168.2.3 scope global eth0:2 inet 192.168.2.5/30 brd 192.168.2.7 scope global eth0:3 inet6 fe80::250:56ff:fe97:c06/64 scope link valid_lft forever preferred_lft forever
-
John almost 11 yearsCan you post the contents of the
ifcfg-eth0:1
file? -
dsmsk80 almost 11 yearsDid you remove/change MAC addresses (HWADDR)?
-
FilBot3 almost 11 yearsNo, I copied what is in the config files. When I created the configs, i just did a `cp ifcfg-eth0 ifcfg-eth0:1 then edited the name and IP address.
-
dsmsk80 almost 11 yearsPlease send output of "ip addr show" from that host. You can have multiple IP addresses on single interface without any sub-interfaces.
-
dsmsk80 almost 11 yearsSimplify/remove the useless directives in the ifcfg-eth0:1, leave only DEVICE=eth0:1, IPADDR=192.168.0.2, IPV6INIT=yes, NETMASK=255.255.255.0, ONBOOT=yes, issue service network restart and test it again
-
dsmsk80 almost 11 yearsIt's not necessary, you create a sub-interface of some interface which already has HWADDR defined.
-
FilBot3 almost 11 yearsSo far, even after trimming the
ifcfg-eth0:1
file down to just those few lines, I'm getting that network interface is in use error. However, when I specified thenetmask
along with the ifconfig command, everything seems to be working just fine. I'm still testing a bit. The command I used wasifconfig eth0:1 192.168.0.2 netmask 255.255.255.0 up
and I can resolve DNS names and such unlike before.
-
-
FilBot3 about 9 yearsSome how, someone had the same IP address as the server I was assigned, so the provisioning team double assigned an IP address.