You are not logged in.

#1 2018-06-05 18:14:56

Proofrific
Member
Registered: 2008-01-05
Posts: 220

[Solved] Diskless Computers Getting Same IP Address

I have a computer lab with diskless clients. Each client has two NICs, one wired to connect to the server, and one wireless to connect to the internet. For the wireless connection, all the clients are getting assigned the same IP address via DHCP, but they need to have different IP addresses. How can we do that?

We're using Network Manager to manage the wireless connection.

Do they have the same IP address because they mount the same server as root? Do I need a tmpfs somewhere?

Thanks!

Last edited by Proofrific (2018-06-05 21:23:12)

Offline

#2 2018-06-05 18:31:58

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [Solved] Diskless Computers Getting Same IP Address

Do the clients have different host names and MAC addresses?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2018-06-05 18:33:35

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,613

Re: [Solved] Diskless Computers Getting Same IP Address

At sounds as if they all have the same MAC address or the same hostname.
Is this not what happened for you here? https://bbs.archlinux.org/viewtopic.php?id=237602

Edit: Too slow

Last edited by ewaller (2018-06-05 18:34:13)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2018-06-05 18:34:20

Proofrific
Member
Registered: 2008-01-05
Posts: 220

Re: [Solved] Diskless Computers Getting Same IP Address

Xyne wrote:

Do the clients have different host names and MAC addresses?

They have different MAC addresses, but the DHCP server is assigning them the same hostname.

Offline

#5 2018-06-05 18:34:58

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,613

Re: [Solved] Diskless Computers Getting Same IP Address


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#6 2018-06-05 18:35:14

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved] Diskless Computers Getting Same IP Address

Only a very broken DHCP server would offer the same IP to multiple clients. Offhand, my guess would be that only one DHCP request is made, resulting in a lease file somewhere in /var which is read by all clients.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#7 2018-06-05 18:35:44

Proofrific
Member
Registered: 2008-01-05
Posts: 220

Re: [Solved] Diskless Computers Getting Same IP Address

ewaller wrote:

At sounds as if they all have the same MAC address or the same hostname.
Is this not what happened for you here? https://bbs.archlinux.org/viewtopic.php?id=237602

Edit: Too slow

When booting on the wired network, each computer gets assigned a different hostname thanks to that post. But when they connect to the wireless network, their hostnames seem to be reassigned to the same thing, to dhcp-<ip address>.

Offline

#8 2018-06-05 18:38:46

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,613

Re: [Solved] Diskless Computers Getting Same IP Address

Oh, I missed that wireless bit.  Sorry. 
I think alphaniner is on to something there...


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#9 2018-06-05 18:39:08

Proofrific
Member
Registered: 2008-01-05
Posts: 220

Re: [Solved] Diskless Computers Getting Same IP Address

alphaniner wrote:

Only a very broken DHCP server would offer the same IP to multiple clients. Offhand, my guess would be that only one DHCP request is made, resulting in a lease file somewhere in /var which is read by all clients.

I was thinking something similar, but I have no idea where the lease file might be. /var/run, which is symlinked to /run, is already tmpfs by default. Would it be bad to mount the entire /var directory as tmpfs?

Offline

#10 2018-06-05 18:44:19

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved] Diskless Computers Getting Same IP Address

I don't use NetworkManager so I can't say how it behaves in Arch. But I found reference to "/var/lib/NetworkManager/dhclient...lease" in an Ubuntu context.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#11 2018-06-05 19:37:41

Proofrific
Member
Registered: 2008-01-05
Posts: 220

Re: [Solved] Diskless Computers Getting Same IP Address

alphaniner wrote:

I don't use NetworkManager so I can't say how it behaves in Arch. But I found reference to "/var/lib/NetworkManager/dhclient...lease" in an Ubuntu context.

It looks like Arch also uses /var/lib/NetworkManager to store leases. I added it to fstab as a tmpfs, but the clients are still getting the same IP address. Is there something that the network administrator at my organization needs to do on their end?

Also, is there a way to prevent the wireless connection from overriding the hostname given by the wired connection? Perhaps that's related?

Thanks for all the help so far!

Offline

#12 2018-06-05 20:19:45

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved] Diskless Computers Getting Same IP Address

It's been a long time since I played with anything like this and it was just one client, one network port, and no NetworkManager.

WRT the IP issue, the only thing I can think of is that NetworkManager is starting before the tmpfs is mounted.

As for the hostname issue, maybe there is something useful here?


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#13 2018-06-05 21:04:39

progandy
Member
Registered: 2012-05-17
Posts: 5,307

Re: [Solved] Diskless Computers Getting Same IP Address

NM uses a unique id to identify itself to the dhcp server which it generates from /etc/machine-id. The dhcp server might provide the same ip if the id is the same regardless of the mac address.
You should remove /etc/machine-id or symlink and generate it from the mac address during bootup. The same with /etc/dhcpcd.duid, which should be unique to each machine as well.

Last edited by progandy (2018-06-05 21:05:08)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#14 2018-06-05 21:22:55

Proofrific
Member
Registered: 2008-01-05
Posts: 220

Re: [Solved] Diskless Computers Getting Same IP Address

progandy wrote:

NM uses a unique id to identify itself to the dhcp server which it generates from /etc/machine-id. The dhcp server might provide the same ip if the id is the same regardless of the mac address.
You should remove /etc/machine-id or symlink and generate it from the mac address during bootup. The same with /etc/dhcpcd.duid, which should be unique to each machine as well.

That fixed it! I removed /etc/machine-id, then set up a symlink

sudo ln -s /run/machine-id /etc/machine-id

Since /run is mounted as tmpfs, this generates a new machine-id with each boot, for each client. Marking as solved.

Offline

#15 2018-06-07 15:05:06

Proofrific
Member
Registered: 2008-01-05
Posts: 220

Re: [Solved] Diskless Computers Getting Same IP Address

Proofrific wrote:

That fixed it! I removed /etc/machine-id, then set up a symlink

sudo ln -s /run/machine-id /etc/machine-id

Since /run is mounted as tmpfs, this generates a new machine-id with each boot, for each client. Marking as solved.

Actually, that wasn't an ideal solution, since each time a client boots, it generates a different machine-id. It should be persistent across boots.

A persistent solution is to create a different PXELINUX configuration file for each client, based on its MAC or IP address. Then in the configuration file, include the systemd.machine_id kernel parameter to set a persistent machine-id for each client.

Offline

Board footer

Powered by FluxBB