IP address conflict after installing NetworkManager

Ask questions about Arch Linux ARM. Please search before making a new topic.

IP address conflict after installing NetworkManager

Postby rogier » Wed Jun 21, 2017 9:30 pm

Hello, fellow Arch users!

I'm using Arch on a bunch of RasPi's centrally managed using Ansible. When I require "advanced networking" on the remote nodes, i.e. anything different than a wired ethernet connection (WiFi and 3G), I install and use NetworkManager and nmcli (and Modem Manager) for its "opportunistic networking capabilities. The RasPi's phone home through an OpenVPN tunnel.

So far so good, this had been working merrily for some time (only using NetworkManager on the nodes requiring 3G modems). Then I experienced nodes dropping off the network in my test environment, I found this was caused by several nodes "sharing" the same IP i.e. conflicting IP's on the local network.

I've tried hooking the nodes to different networks (suspecting a router/dhcp server bug/issue), and each time was able to reproduce the problem. It really struck me that something trivial as a getting an ordinary DHCP lease on the fixed network is not working properly.

This is what `ip a` gets me right after installing and starting NetworkManager:

ip a on Node 1
Code: Select all
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether b8:27:eb:98:19:b1 brd ff:ff:ff:ff:ff:ff
    inet 10.135.10.193/24 brd 10.135.10.255 scope global dynamic eth0
       valid_lft 545sec preferred_lft 545sec
    inet 10.135.10.90/24 brd 10.135.10.255 scope global secondary dynamic eth0
       valid_lft 544sec preferred_lft 544sec


ip a on Node 2
Code: Select all
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether b8:27:eb:16:3d:b2 brd ff:ff:ff:ff:ff:ff
    inet 10.135.10.193/24 brd 10.135.10.255 scope global dynamic eth0
       valid_lft 545sec preferred_lft 545sec
    inet 10.135.10.61/24 brd 10.135.10.255 scope global secondary dynamic eth0
       valid_lft 542sec preferred_lft 542sec


In the above output there are still 2 IP's assigned on the interface, one is coming from systemd-networkd, after a reboot the secondary addresses are gone and only the conflicting ones (10.135.10.193 in this case) are left.

How is it possible the two boxes are assigned the same IP by the DHCP server? Am I overlooking something? Or could this be a NetworkManager bug?

Ps I don't apply any specific configuration to the eth0 wired interface in NetworkManager and just take what it gets me by default.

Hope anyone can shed some light on this seemingly trivial problem.. !
rogier
 
Posts: 2
Joined: Wed Jun 21, 2017 9:26 pm

Re: IP address conflict after installing NetworkManager

Postby WarheadsSE » Thu Jun 22, 2017 1:42 pm

Is this just one pair of nodes, or are, say, 5 of them doing this?

It is interesting as they are showing different MACs and as such, in theory, should never have this issue. NM can be an idiot, but I have certainly never seen this. If you're using systemd-networkd for the eth, you should probably just tell NM to buzz off (ignore the interface) as you're only using it for the 3G ?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6730
Joined: Mon Oct 18, 2010 2:12 pm

Re: IP address conflict after installing NetworkManager

Postby rogier » Thu Jun 22, 2017 6:49 pm

It is interesting as they are showing different MACs and as such, in theory, should never have this issue


You totally right! :) It really struck me this was the case, haven't seen anything like this in my almost 2 decades using Linux and doing networking. (Because it was so not-to-be-expected source of problem, it took me a while to find out this was causing my disappearing nodes) When searching the web for DHCP and IP conflicts you always end up on fora "solving" the trivial causes / problems.

I typically have the issue on nodes on which I deploy NM (near)-simultaneously with Ansible. Maybe this causes some condition in my dhcp server. Could it be NM sends the DHCP req. when the MAC address is not set correctly to the default HW MAC address on the interface? (sounds far-fetched, but hey.. that's where we are already, right) Also tried to configure NM with it's internal dhcp client (dhcp=internal), without success.

If you're using systemd-networkd for the eth, you should probably just tell NM to buzz off (ignore the interface) as you're only using it for the 3G ?


I use NM for everything else than vanilla wired ethernet. I was planning to install it as standard on all nodes to have more flexible networking by default. Haven't done this yet for obvious reasons. On the nodes configured with NM, I disabled systemd-networkd, so only NM is managing my interfaces. Possibly I could go the other way around and let NM only manage 3G and WiFi connections. (although I like the idea that one process is managing all networking, in order to prevent conflicts of some sort).
rogier
 
Posts: 2
Joined: Wed Jun 21, 2017 9:26 pm


Return to User Questions

Who is online

Users browsing this forum: No registered users and 4 guests