9

I am seeing two IP address on a single interface in a weird way. This is my output of ifconfig -a

eth0      Link encap:Ethernet  HWaddr b8:27:eb:26:b1:c8  
          inet addr:10.0.0.22  Bcast:10.255.255.255  Mask:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:456 errors:0 dropped:0 overruns:0 frame:0
          TX packets:519 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:63643 (62.1 KiB)  TX bytes:111910 (109.2 KiB)

This is my /etc/network/interfaces file output

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet static
        address 10.0.0.22
        subnet  255.255.255.0
        gateway 10.0.0.1

auto eth1
allow-hotplug eth1
iface eth1 inet static
#       address 0
#       subnet  255.255.255.0
#       gateway 192.168.0.2

And this is my output for sudo ip addr show

1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether b8:27:eb:26:b1:c8 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.22/8 brd 10.255.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.0.0.100/24 brd 10.0.0.255 scope global eth0
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP qlen 1000
    link/ether 00:00:00:00:6c:f8 brd ff:ff:ff:ff:ff:ff
    inet 169.254.78.64/16 brd 169.254.255.255 scope global eth1
       valid_lft forever preferred_lft forever

As we can see here eth0 has two ip address and is only shown by ip command and not by ifconfig or /etc/network/interfaces file. I am unable to understand from where this is coming or how to disable the 2nd IP permanently. I would like to get rid of the 2nd IP address permanently.

I have also noticed that this IP comes after a second or so when the system is booted. When I do dmesg I see these are the last few lines-

[   15.270464] device eth1 entered promiscuous mode
[   15.576206] asix 1-1.4:1.0 eth1: link up, 100Mbps, full-duplex, lpa 0xCDE1
6
  • What's the question here? It is entirely possible to have multiple IP addresses assigned to the same device.
    – Thomas Ward
    Oct 12, 2015 at 18:38
  • I would like to get rid of the other IP address permanently (even after reboots).
    – The Prenx
    Oct 12, 2015 at 18:42
  • Make sure that you don't use auto and allow-hotplug together - one or the other will work (start with that). See if on reboot it still gets two addresses.
    – Thomas Ward
    Oct 12, 2015 at 18:44
  • I tried removing "auto" and "allow-hotplug" lines individually and both at the same time and rebooted but I still get the same result.
    – The Prenx
    Oct 12, 2015 at 18:52
  • It seems that subnet setting of your interfaces is not respected either. Maybe you should call it netmask
    – user448115
    Oct 12, 2015 at 19:41

4 Answers 4

5

I had the same issue.

Finally found that in my distro (debian jessie) the static ip is set in the file /etc/dhcpcd.conf and looked like:

 ...
 39 # A hook script is provided to lookup the hostname if not set by the DHCP
 40 # server, but it should not be run by default.
 41 nohook lookup-hostname
 42 ## interface eth0
 43   static ip_address=192.168.1.2/24
 44   static routers=192.168.1.254
 45   static domain_name_servers=192.168.1.254
 46 ## interface eth0
 47   static ip_address=192.168.0.3/24
 48   static routers=192.168.0.1
 49   static domain_name_servers=192.168.0.1

So I've removed that additional record from that file and it fixed that issue permanently.

Hope it will help someone...

2

Old thread I know but,

eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether b8:27:eb:26:b1:c8 brd ff:ff:ff:ff:ff:ff
    **inet 10.0.0.22/8** brd 10.255.255.255 scope global eth0
       valid_lft forever preferred_lft forever

    **inet 10.0.0.100/24** brd 10.0.0.255 scope global eth0
       valid_lft forever preferred_lft forever

The request was "How do I get rid of the "10.0.0.100/24" address

This will get rid of it

ip address del 10.0.0.100/24 dev eth0

This will put it back

ip address add 10.0.0.100/24 dev eth0

These are both "non-persistent" so a better question might be what keeps putting that address on your interface

0

I ran into this same issue.

After trying to set a static IP in my /etc/netplan/99-config.yaml and still not being able to get a network connection (as well as seeing two IP addresses with ip a). I dug around and read that dhcpd could be a possible cause.

cat /etc/dhcpd.conf

Produced:

...
# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private
interface enp3s0
        static ip_address=192.168.0.15/24
        static routers=192.168.0.1
        static domain_name_servers=127.0.0.1

Where I could see that for some reason I had set a static IP in /etc/dhcpd.conf.

So I removed those lines and I finally was able to establish a network connection, and ip a showing just the single the static IP I had set in /etc/netplan/99-config.yaml.

-4

A whois query on that IP address shows:

WHOIS results for 169.254.78.64
NetRange:       169.254.0.0 - 169.254.255.255
CIDR:           169.254.0.0/16
NetName:        LINKLOCAL-RFC3927-IANA-RESERVED
NetHandle:      NET-169-254-0-0-1
Parent:         NET169 (NET-169-0-0-0-0)
NetType:        IANA Special Use
OriginAS:
Organization:   Internet Assigned Numbers Authority (IANA)
RegDate:        1998-01-27
Updated:        2014-01-09
Comment:        Computers use addresses starting with "169.254." when they do not have a manually configured address or when they are not told which address to use by a service on the network.  They are commonly called the "link local" addresses.
Comment:
Comment:        Routers are not allowed to forward packets sent from an IPv4 "link local" address, so they are always used by a directly connected device.
Comment:
Comment:        These addresses were assigned by the IETF, the organization that develops Internet protocols, in the Standards Track document, RFC3927, which can be found at:
Comment:        http://datatracker.ietf.org/doc/rfc3927
Ref:            http://whois.arin.net/rest/net/NET-169-254-0-0-1

so it's not a big problem. The interface is promiscuous, which means it will receive ALL packets.

To see which processes have it open, man lsof, sudo lsof /dev/eth1 will help.

2
  • that's eth1 and not the focus of the OP's question. OP wants to remove one of the two IP addresses on eth0, not eth1
    – Thomas Ward
    Oct 12, 2015 at 18:55
  • Well, I don't care about this IP for eth1. My concern is for eth0 which has two IP address and the rogue IP I want to get rid of permanently is 10.0.0.100/24
    – The Prenx
    Oct 12, 2015 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.