# NetworkManager removes ip address and route

## cmdic

Hi everyone,

I have this weird behaviour of NetworkManager:

```

Nov 12 19:02:11 localhost dhcpcd[3599]: version 6.1.0 starting

Nov 12 19:02:11 localhost NetworkManager[2049]: <info> dhcpcd started with pid 3599

Nov 12 19:02:11 localhost NetworkManager[2049]: <info> Activation (eth1) Stage 3 of 5 (IP Configure Start) complete.

Nov 12 19:02:11 localhost NetworkManager[2049]: <info> (eth1): DHCPv4 state changed nbi -> preinit

Nov 12 19:02:11 localhost dhcpcd[3599]: eth1: rebinding lease of 192.168.178.21

Nov 12 19:02:16 localhost dhcpcd[3599]: eth1: leased 192.168.178.21 for 864000 seconds

Nov 12 19:02:16 localhost dhcpcd[3599]: eth1: adding host route to 192.168.178.21 via 127.0.0.1

Nov 12 19:02:16 localhost dhcpcd[3599]: eth1: adding route to 192.168.178.0/24

Nov 12 19:02:16 localhost NetworkManager[2049]: <info> (eth1): DHCPv4 state changed preinit -> bound

Nov 12 19:02:16 localhost NetworkManager[2049]: <info>   address 192.168.178.21

Nov 12 19:02:16 localhost NetworkManager[2049]: <info>   prefix 24 (255.255.255.0)

Nov 12 19:02:16 localhost NetworkManager[2049]: <info>   gateway 192.168.178.1

Nov 12 19:02:16 localhost NetworkManager[2049]: <info>   nameserver '192.168.178.1'

Nov 12 19:02:16 localhost NetworkManager[2049]: <info>   domain name 'fritz.box'

Nov 12 19:02:16 localhost NetworkManager[2049]: <info> Activation (eth1) Stage 5 of 5 (IPv4 Configure Commit) scheduled...

Nov 12 19:02:16 localhost NetworkManager[2049]: <info> Activation (eth1) Stage 5 of 5 (IPv4 Commit) started...

Nov 12 19:02:16 localhost dhcpcd[3599]: eth1: removing IP address 192.168.178.21/24

Nov 12 19:02:16 localhost dhcpcd[3599]: eth1: deleting host route to 192.168.178.21 via 127.0.0.1

Nov 12 19:02:16 localhost dhcpcd[3599]: eth1: deleting route to 192.168.178.0/24

Nov 12 19:02:17 localhost NetworkManager[2049]: <info> (eth1): device state change: ip-config -> secondaries (reason 'none') [70 90 0]

Nov 12 19:02:17 localhost NetworkManager[2049]: <info> Activation (eth1) Stage 5 of 5 (IPv4 Commit) complete.

Nov 12 19:02:17 localhost NetworkManager[2049]: <info> (eth1): DHCPv4 state changed bound -> expire

Nov 12 19:02:17 localhost NetworkManager[2049]: <info> (eth1): device state change: secondaries -> activated (reason 'none') [90 100 0]

Nov 12 19:02:17 localhost NetworkManager[2049]: <info> Policy set 'eth1' (eth1) as default for IPv4 routing and DNS.

Nov 12 19:02:17 localhost NetworkManager[2049]: <info> Activation (eth1) successful, device activated.

```

to be able to go online I have to add the Ip manually via:

ifconfig eth1 192.168.178.21 netmask 255.255.255.0

any suggestions?

----------

## dE_logics

What networkmanager clients are you running?

----------

## cmdic

Just the gnome-applet nm-applet aka NetworkManager

----------

## 666threesixes666

as root you must remove any dhcpcd auto start features, or it will conflict with networkmanagers starting of dhcpcd

rc-update del dhcpcd

can you manually connect via nm-applet punching in the ip & dns & other info?

----------

## cmdic

Hi,

I haven't tried to put them into nm-applet.

But shall I remove dhcpd from autostart?

It might be possible that I have added dhcpd, while upgrading to systemd.

----------

## 666threesixes666

yeah remove any auto start of dhcpcd.  you'll have to dig around systemctl or what ever systemd uses.  if not you should be able to work around it for a bit with manually setting ip addy info in nm-applet by right clicking nm-applet and edit network connections.

id go through the whole gauntlet of testing openrc working with NM...  get openrc working, then add complexity to your problem jumping over to systemd. then finally remove all manual ip addresses.

----------

## dziadu

Hi, I have exactly the same problem, but I also found that problem exists with dhcpcd version higher than 6.0.5. Below are my 6.3.1 and 6.0.5 logs:

6.3.1

 *Quote:*   

> Mar 19 08:31:38 hadesnbp023 NetworkManager[17743]: <info> (wlp12s0): supplicant interface state: associating -> associated
> 
> Mar 19 08:31:38 hadesnbp023 NetworkManager[17743]: <info> (wlp12s0): supplicant interface state: associated -> completed
> 
> Mar 19 08:31:38 hadesnbp023 NetworkManager[17743]: <info> Activation (wlp12s0/wireless) Stage 2 of 5 (Device Configure) successful.  Connected to wireless network 'ALICE-WLAN28'.
> ...

 

 *Quote:*   

> # ifconfig wlp12s0
> 
> wlp12s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
> 
>         ether xx:xx:xx:xx:xx:xx  txqueuelen 1000  (Ethernet)
> ...

 

6.0.5

 *Quote:*   

> Mar 19 08:53:13 hadesnbp023 NetworkManager[27182]: <info> (wlp12s0): supplicant interface state: associating -> associated
> 
> Mar 19 08:53:13 hadesnbp023 NetworkManager[27182]: <info> (wlp12s0): supplicant interface state: associated -> 4-way handshake
> 
> Mar 19 08:53:17 hadesnbp023 NetworkManager[27182]: <info> (wlp12s0): supplicant interface state: 4-way handshake -> completed
> ...

 

 *Quote:*   

> # ifconfig wlp12s0
> 
> wlp12s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
> 
>         inet 192.168.1.18  netmask 255.255.255.0  broadcast 192.168.1.255
> ...

 

I don't think that it could be Network Manager problem, since it was many times recompiled since the first time when problem appeared.

I tried to remove duid option from dhcpcd config as suggested here: https://bugs.gentoo.org/show_bug.cgi?id=477356, I also recompiled dhcpcd without ipv6, but no improvements.

Any ideas?

Greetings,

dziadu

----------

## UberLord

```
removing IP address 192.168.1.17/24 
```

That message means that dhcpcd received a kernel message that the ip address had been deleted by something else.

You could try adding the debug directive to /etc/dhcpcd.conf to get more logging if you think it's a dhcpcd failure.

----------

## dziadu

But the same message appears for 6.0.5's log but IP is assigned anyway. I don't know if the problem is actually related to removing of the address (I posted in this topic because it had the same message and it misled me, but now I see that it could be not related to 'removing' message).

man for the dhcpcd.conf doesn't show any function to run debuging, but there is an 'quite' option, so I think the output we see is the max we can get.

----------

## boospy

Build sys-apps/net-tools with useflag "old-output" and try again.

----------

## lkraav

I'm seeing the exact same problem with dhcpcd 6.2.0 and higher. What a mess :/

----------

## UberLord

 *dziadu wrote:*   

> But the same message appears for 6.0.5's log but IP is assigned anyway. I don't know if the problem is actually related to removing of the address (I posted in this topic because it had the same message and it misled me, but now I see that it could be not related to 'removing' message).
> 
> man for the dhcpcd.conf doesn't show any function to run debuging, but there is an 'quite' option, so I think the output we see is the max we can get.

 

Hmm, it seems it's just not documented. Fixed here:

http://roy.marples.name/projects/dhcpcd/fdiff?v1=5beebccc08e91953&v2=fa72885e2c5297cd&sbs=1

Now you can find out if dhcpcd is to blame or not. But pay close attention as dhcpcd will spot a 3rd party removing the address and log this and the wording is similar as dhcpcd removing it by itself.

Post the logs here if confused and you think dhcpcd is removing the address still  :Smile: 

----------

