rock64 with static ip only

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

rock64 with static ip only

Postby mcloaked » Tue Mar 04, 2025 9:21 pm

I have until now only run the rock64 with dhcp with the default systemd-networkd definition file:

[code]
$ cat /etc/systemd/network/en.network
[Match]
Name=en*

[Network]
DHCP=yes
DNSSEC=no
[/code]

I spent a considerable time trying to switch to a static ip only but despite trying multiple different [Network] stanza sections to define a static ip address only instead of dhcp assigned pool address, the system failed to boot, and it was necessary to remove the microsd card, and mount it in a laptop and then copy back the original en.network file. The system appeared to boot but was not accessible via ssh and is headless, so there was no way to then access the system.

Finally the only solution I could find was to simply add an address stanza with a single line definition, to have the rock64 use both the dhcp pool assigned ip address as well as my static address as per:

[code]
$ cat /etc/systemd/network/en.network
[Match]
Name=en*

[Network]
DHCP=yes
DNSSEC=no

[Address]
Address=172.20.0.8/24
[/code]

This boots fine and the interface has both ip addresses.

However has anyone found a way to give the rock64 a static ip only, and still boot without a problem?
mcloaked
 
Posts: 97
Joined: Thu Oct 16, 2014 4:16 pm

Re: rock64 with static ip only

Postby solskogen » Wed Mar 05, 2025 7:11 am

Just comment out the DHCP line.
solskogen
 
Posts: 215
Joined: Mon Nov 18, 2013 10:41 am

Re: rock64 with static ip only

Postby mcloaked » Wed Mar 05, 2025 8:48 am

I did comment out the dhcp line but with various combinations of lines to set up static ip, none worked. The last one that I tried was this:

[code]
[Match]
Name=en*

[Network]
Description=rock64
Address=172.20.0.8/24
Gateway=172.20.0.135
Address=fd00:abad:f00d:d00d::8/48
DNS=127.0.0.1
DNSSEC=no
IPv6PrivacyExtensions=true
[/code]

I don't know if there is something fundamental in the file that I have not put in to get static ip only to work, but with this .network file it fails to boot up and have the network running. I suppose it is possible that another stanza may be required, such as

[IPv6AcceptRA]
RouteMetric=512

If you know what I am missing I would appreciate any suggestions.
mcloaked
 
Posts: 97
Joined: Thu Oct 16, 2014 4:16 pm

Re: rock64 with static ip only

Postby mcloaked » Wed Mar 05, 2025 8:49 am

By the way I referred to 127.0.0.1 for dns since I have unbound running to handle it.
mcloaked
 
Posts: 97
Joined: Thu Oct 16, 2014 4:16 pm

Re: rock64 with static ip only

Postby mcloaked » Wed Mar 05, 2025 9:24 am

Also with the network file that I quoted if I systemctl daemon-reload and then restart systemd-networkd then the ssh connection hangs immediately and I then have to take the microsd card out and restore the original en.network file before the rock64 will boot and have a working network connection again.
mcloaked
 
Posts: 97
Joined: Thu Oct 16, 2014 4:16 pm

Re: rock64 with static ip only

Postby baslking » Sun Mar 23, 2025 5:48 pm

Not sure which kernel you are running, but I have an Odroid M1S based on Rock64, when I upgraded to 6.13 kernel, I noticed that the MAC address changed at every boot after the kernel upgrade. I could not find with any known command the "real hardware mac address" of the interface. I just chose one after booting and set it permanently in the link file. Then your dhcp server can be configured with this fixed spoofed mac address for a stable IP address. lots of modern OS's seem to be spoofing MAC addresses on every boot for security reasons, but they wreck havoc on MAC based configs and filtering tools. The OS running on my Odroid is a Debian but the commands are the same. I suspect your system, like mine, may not store a permanent MAC address so the one you get may not be stable.

The Link file I used:
[Match]
Type=ether

[Link]
NamePolicy=mac
MACAddress=xx:xx:xx....
baslking
 
Posts: 16
Joined: Thu Feb 18, 2021 10:53 pm

Re: rock64 with static ip only

Postby mcloaked » Fri Mar 28, 2025 4:45 pm

Thanks - I don't think it is the MAC address causing my issue. I have now been running with the network file as

[Match]
Name=en*

[Network]
DHCP=yes
DNSSEC=no
Address=172.20.0.8/24

and with this the rock64 does get both an ip address from the router, as well as the address I set as above - the dhcp ip address seems to be stable, but the 172.x.x.x address I assign seems to stay for about two days and then disappears leaving only the dhcp assigned address. If I restart systemd-networkd then my fixed ip address is re-assigned. So I still don't understand what is happening but I will monitor the MAC address and check if it does change as per your post.
mcloaked
 
Posts: 97
Joined: Thu Oct 16, 2014 4:16 pm

Re: rock64 with static ip only

Postby mcloaked » Fri Mar 28, 2025 5:13 pm

I looked more at the status from systemd-networkd and noticed a very odd time in the log/status part way through. This led me to check the system time and I found that although the system time was correct the hardware clock was over a month earlier in time. So I have synced the system time to the hardware clock, and now restarting systemd-networkd gives consistent times in the status. So I will run with this for a while and see if that affects the ip address over a period of days.

I had thought that the hardware clock was automatically synced to the system time but I will need to look further into why that was not the case.
mcloaked
 
Posts: 97
Joined: Thu Oct 16, 2014 4:16 pm

Re: rock64 with static ip only

Postby mcloaked » Sat Mar 29, 2025 9:45 pm

It turned out the rtc time was a red herring. I have now changed the network file to include

[DHCPv4]
RequestAddress=xx.yy.0.8

This is in addition to the DHCP this now boots and the rock64 gets only the address I added to that section. I will now have to see if the loss of the address still happens. Previously after the lease timeout the address was removed and a dhcp server only address remained - with the above there is only the one address, which is requested but seems to be assigned from the dhcp server.
mcloaked
 
Posts: 97
Joined: Thu Oct 16, 2014 4:16 pm


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 13 guests