New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign fixed MAC address to device #158

Closed
ThomDietrich opened this Issue Jun 13, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@ThomDietrich
Member

ThomDietrich commented Jun 13, 2017

@1activegeek

This comment has been minimized.

Show comment
Hide comment
@1activegeek

1activegeek Jun 16, 2017

@ThomDietrich - So perhaps I didn't follow all the cookie crumble trails - is the idea here that the OpenHABian setup DOES NOT retain the MAC address on boot? I thought it was retaining this. In my current setup, I have a static IP set on the Router/Gateway side. So far I've seen my physical NIC get a static IP even upon restart. I don't recall if I had also specifically set an IP locally though.

IF this is an opinion based situation, I would say we should absolutely be setting a static MAC for the board and it should match the default standard issued (I believe on the sticker illustrated in one of the posts). This is a common setup to have the router/gateway handling the IP assignment, even when using static IPs. The reason is that it affords easy alteration.

i.e. - Today I decide my OpenHABian image should located at IP 10.0.0.2. Tomorrow, I decide it should be 10.0.0.3. Rather than physically going to my system via SSH and manually changing this detail, I just change the static setting on the router/gateway side, and voila, its applied upon next IP refresh from the Pine.

On a small scale, it's probably not as largely important. On the larger scale (i.e. most of us tinkerers with expansive amounts of devices) it makes life so much easier when an eventual network re-mapping needs to take place. It also provide an inherent "uh oh something is wrong" indicator. All of a sudden I can't reach the Pine, hmm something maybe flakey on the network, let's dig in - oh DHCP has a problem, or hey the router has an issue, or uh oh the Pine isn't getting an IP! 😉

1activegeek commented Jun 16, 2017

@ThomDietrich - So perhaps I didn't follow all the cookie crumble trails - is the idea here that the OpenHABian setup DOES NOT retain the MAC address on boot? I thought it was retaining this. In my current setup, I have a static IP set on the Router/Gateway side. So far I've seen my physical NIC get a static IP even upon restart. I don't recall if I had also specifically set an IP locally though.

IF this is an opinion based situation, I would say we should absolutely be setting a static MAC for the board and it should match the default standard issued (I believe on the sticker illustrated in one of the posts). This is a common setup to have the router/gateway handling the IP assignment, even when using static IPs. The reason is that it affords easy alteration.

i.e. - Today I decide my OpenHABian image should located at IP 10.0.0.2. Tomorrow, I decide it should be 10.0.0.3. Rather than physically going to my system via SSH and manually changing this detail, I just change the static setting on the router/gateway side, and voila, its applied upon next IP refresh from the Pine.

On a small scale, it's probably not as largely important. On the larger scale (i.e. most of us tinkerers with expansive amounts of devices) it makes life so much easier when an eventual network re-mapping needs to take place. It also provide an inherent "uh oh something is wrong" indicator. All of a sudden I can't reach the Pine, hmm something maybe flakey on the network, let's dig in - oh DHCP has a problem, or hey the router has an issue, or uh oh the Pine isn't getting an IP! 😉

@ThomDietrich

This comment has been minimized.

Show comment
Hide comment
@ThomDietrich

ThomDietrich Jun 16, 2017

Member

Hey @1activegeek, you got me wrong there. The current situation is, that the system WILL choose a random MAC every boot. This will of course mess with the DHCP server and your use case as you describe it. This behavior is not acceptable.

Example:

  • MAC: 3e:4c:16:00:91:89
  • Reboot, device received a new IP
  • MAC: 46:dd:c3:99:28:dc
  • Looking at dmesg:
[18:09:53] openhabian@openHABianPine64:~$ dmesg | grep "mac address"
[    7.993562] eth0: Use random mac address
Member

ThomDietrich commented Jun 16, 2017

Hey @1activegeek, you got me wrong there. The current situation is, that the system WILL choose a random MAC every boot. This will of course mess with the DHCP server and your use case as you describe it. This behavior is not acceptable.

Example:

  • MAC: 3e:4c:16:00:91:89
  • Reboot, device received a new IP
  • MAC: 46:dd:c3:99:28:dc
  • Looking at dmesg:
[18:09:53] openhabian@openHABianPine64:~$ dmesg | grep "mac address"
[    7.993562] eth0: Use random mac address

ThomDietrich added a commit that referenced this issue Jun 16, 2017

Save initial random mac as permanent mac
See https://forum.pine64.org/showthread.php?tid=743

Resolves #158

Signed-off-by: Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>
@1activegeek

This comment has been minimized.

Show comment
Hide comment
@1activegeek

1activegeek Jun 16, 2017

Interesting, I was not aware. I'll have to check if I was using a static IP because I had seen this early on. I've had a bad habit in the past of not documenting things as I go along. I've more recently started documenting everything in a GitLab wiki (private repo of course) to help remember what I did. 😄

Glad to see the change/update was easy enough. Will this be in the new version you were putting together today/tomorrow?

1activegeek commented Jun 16, 2017

Interesting, I was not aware. I'll have to check if I was using a static IP because I had seen this early on. I've had a bad habit in the past of not documenting things as I go along. I've more recently started documenting everything in a GitLab wiki (private repo of course) to help remember what I did. 😄

Glad to see the change/update was easy enough. Will this be in the new version you were putting together today/tomorrow?

@ThomDietrich

This comment has been minimized.

Show comment
Hide comment
@ThomDietrich

ThomDietrich Jun 16, 2017

Member

Even with the mac and IP changing the hostname would still stay unchanged. Maybe you used the name and didn't even realize the IP was changing. Anyhow the PR above is tested and will be available with the new image. I just have to draft a short release note...

Member

ThomDietrich commented Jun 16, 2017

Even with the mac and IP changing the hostname would still stay unchanged. Maybe you used the name and didn't even realize the IP was changing. Anyhow the PR above is tested and will be available with the new image. I just have to draft a short release note...

@1activegeek

This comment has been minimized.

Show comment
Hide comment
@1activegeek

1activegeek Jun 16, 2017

No in my case I was going to the same IP. I had the hostname actually setup in my own DNS listing for the IP and in many instances (I was testing some new networking gear) I was falling back to IP manually anyhow. The Wifi address has always changed, but that's because I'm not setting that static. That causes some other chaos - but thats specific to my environment.

1activegeek commented Jun 16, 2017

No in my case I was going to the same IP. I had the hostname actually setup in my own DNS listing for the IP and in many instances (I was testing some new networking gear) I was falling back to IP manually anyhow. The Wifi address has always changed, but that's because I'm not setting that static. That causes some other chaos - but thats specific to my environment.

@1activegeek

This comment has been minimized.

Show comment
Hide comment
@1activegeek

1activegeek Jun 16, 2017

Thanks! - I'll check for it later, and hopefully get a chance to run this weekend. Thanks for the work in improving this bad boy!

1activegeek commented Jun 16, 2017

Thanks! - I'll check for it later, and hopefully get a chance to run this weekend. Thanks for the work in improving this bad boy!

@jamsven

This comment has been minimized.

Show comment
Hide comment
@jamsven

jamsven Jul 22, 2017

I updated openhabian today and got same issue... on every reboot my mac changed randomly. Is there a quick workaround for his issue out yet?

Im using rp3 via Lan

thx Sven

jamsven commented Jul 22, 2017

I updated openhabian today and got same issue... on every reboot my mac changed randomly. Is there a quick workaround for his issue out yet?

Im using rp3 via Lan

thx Sven

@ThomDietrich

This comment has been minimized.

Show comment
Hide comment
@ThomDietrich

ThomDietrich Jul 23, 2017

Member

This one:
#160
It's however only triggered on a fresh installation. You might need to go though the steps yourself.

Member

ThomDietrich commented Jul 23, 2017

This one:
#160
It's however only triggered on a fresh installation. You might need to go though the steps yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment