3

I've just installed the new debian 10.4.0-amd64-standard.

I configured the network interface ip to static (eth0):

iface eth0 inet static
address 10.1.1.41/24
gateway 10.1.1.1
dns-nameservers 10.1.1.20

But when I type ip addr I get two ip addresses on the same interface.

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:01:0a:09 brd ff:ff:ff:ff:ff:ff
    inet 10.1.1.103/24 brd 10.1.1.255 scope global dynamic eth0
       valid_lft 549236sec preferred_lft 549236sec
    inet 10.1.1.41/24 brd 10.1.1.255 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe01:a09/64 scope link
       valid_lft forever preferred_lft forever

What do I have to do to get rid of the DHCP IP "10.1.1.103"?

As requested output of ps aux | grep dhcp:

root        381  0.0  0.2   9488  5736 ?        Ss   Aug12   0:00 /sbin/dhclient -4 -v -i -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases -I -df /var/lib/dhcp/dhclient6.eth0.leases eth0
root      12551  0.0  0.0   6076   828 pts/0    S+   07:43   0:00 grep dhcp

After disabling the dhcp service. This shows up when I type ifup eth0:

sudo ifup eth0
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/00:15:5d:01:0a:09
Sending on   LPF/eth0/00:15:5d:01:0a:09
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPOFFER of 10.1.1.103 from 10.1.1.20
DHCPREQUEST for 10.1.1.103 on eth0 to 255.255.255.255 port 67
DHCPACK of 10.1.1.103 from 10.1.1.20
bound to 10.1.1.103 -- renewal in 1523 seconds.

Looks like it is still requesting the dhcp for an ip.

14
  • 2
    Possibly a reboot should solve this. How did you install the static interface? Or dhcp worked in parallel, and so installed an additional interface, or you may have some extra command do get DHCP data. Or you may have additional configuration in /etc/network. You have ipv6, so something else configured it (or you did ipdown eth0 before reload the new data Commented Aug 12, 2020 at 14:17
  • your file seems to not have been read ; restart network(ing) service(s) first ; then make your file more intelligent & more complete & restart network again. if it does not solve you problem reboot ; if it still not solve erase the file & reboot again without network to start setup from scratch
    – francois P
    Commented Aug 12, 2020 at 14:19
  • 1
    Please convert your pictures of text into text. This will make you question more accessible e.g. to blind people. Commented Aug 13, 2020 at 15:05
  • 1
    @roaima Did that...
    – Fabian
    Commented Aug 14, 2020 at 6:47
  • 1
    @GiacomoCatenazzi theres no additional eth0 interface. Yeah I know I already did ifup and ifdown
    – Fabian
    Commented Aug 14, 2020 at 6:47

5 Answers 5

1

I just ran into this as well on a fresh install of Debian 11 on 5 Mac Minis and wanted to share what I found. Digging into /var/log/syslog, I noticed that connmand was bringing up my Ethernet and requesting DHCP. Then about 5 seconds later, dhclient was doing the same.

This resulted in two IP addresses being assigned to my machines. I removed connman package, rebooted, and everything is happy now only pulling a single DHCP request.

0

Most likely, you have Network Manager still running: the extra ip address your eth0 interface gets can only come from a DHCP request (as shown also by the presence of dhclient in the output of ps aux).

Just disable it,

sudo systemctl disable network-manager

and reboot to check that now you are indeed getting a single IP address.

1
  • I added the answer to your recommendation to my post...
    – Fabian
    Commented Aug 14, 2020 at 11:29
0

Got the same issue recently:

You can resolve it in systemd like this:

You do not need to add/modify file /etc/network/interfaces to setup an IP

mv /etc/systemd/network/99-dhcp.network   /etc/systemd/network/99-static.network

edit the renamed file:

Inside replace [network] part from DHCP to:

[NETWORK]

Address=xxx.xxx.xxx.xxx/yy

Gateway=xxx.xxx.xxx.xxx

DNS=xxx.xxx.xxx.xxx.xxx

(Just in case check the [MATCH] section has a correct expression to match your iface name like: Name=e* )

Then reboot

0

For me, I installed a new Debian 11 (console only) and then added my xfce4, xorg etc... so as to avoid all the un-needed add on packages. I could not get a Network Icon to work on my xfce4 panel without adding network-manager and putting it in control. Once I did that, I could get my Icon back but then ended up with two IP addresses (just as this OP described).

It stayed that way until I removed isc-dhcp-client. Once that was done things worked as expected - seems that if the two network manager packages will run on top of each other - that installing one might remove the other? Anyway that seemed to work for me.

0

I just figured out a solution and will share a theory about what I think was happening.

On my system, at least, it looks like the interface is assigned connections from NetworkManager and /etc/network/interfaces. I was digging around the NetworkManager man pages and in NetworkManager.conf(5), in section IFUPDOWN SECTION, it says that if the managed variable is set to false, "any interface listed in /etc/network/interfaces will be ignored by NetworkManager."

When I set managed to true, the first of the two connections went away (after restarting networking), leaving the only defined connection the one I defined in /etc/network/interfaces.

I hesitate to speculate further because I often misinterpret what I think are clues, but I can't help myself.

My objective was to have a static IP address, which I defined in /etc/network/interfaces, but calling ip address always showed a DHCP-defined address. I installed isc-dhcp-client and kept trying to get a static address until I noticed that (for who knows how long) multiple IP addresses were listed, one of which was the one I defined in /etc/network/interfaces. This contradicts NetworkManager.conf(5), which says that it should have been ignored if managed is set to false. Perhaps installing the DHCP client overrode NetworkManager.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .