Static IP Configuration for CM4 Nodes
# │forum
s
Hi All ... What's the best way to configure a Static IP address for all four CM4 Nodes in my Turing Pi 2? I've tried editing the dhcpcd.conf file, with mixed results, and typically end up crippling my network connection. Is there a way to establish DNS resolution and Static IP addressing at the BMC level? Please advise ... Stephen
d
Hi!
You might try:
I've never used that on my own, but people mentioned it works
You have to edit
/boot/cmdline.txt
and put it there
Just found this: https://kr15h.github.io/RPi-Setup/#titles.3.1 - should be helpful
s
The first option speaks to BMC configuration, yes?
d
BMC has nothing to do with the node operating system so also the IP assigments
s
OK, I was under the impression there was a unifying mechanism that could be ... tweaked.
d
In the future, maybe, but that'd require modifying the node system images
s
All the "Conventional Wisdom" I came across pointed to the /etc/dhcpcd.conf file. And each time I tried that approach, I hamstrung my network connection. When is the dhcpcd.conf approach viable?
d
I mean this is Raspbian, based on Debian (or ubuntu? Also based on Debian, but I'm unsure what you are running), so this should work. But I'm not sure which changes are you making and what, potentially, might be wrong
If you share exactly what changes are you doing, it'd be easier to maybe find out why is it not working for you
s
Sorry about that: I'm running Raspberry Pi 64-bit OS (Bullseye).
One other question, related to the desire to establish a Static IP: Does a Kubernetes Cluster absolutely require a Static IP, or can a hostname be plugged into the slot here: curl -sfL https://get.k3s.io | K3S_TOKEN="" K3S_URL="https://:6443" K3S_NODE_NAME="servername" sh -
d
I've never used Kubernetes before, so someone else would have assist you here, but I guess as long as long as your DHCP server assigns the same IPs (static lease on the DHCP?) you should be fine
Hostnames probably should work (again, someone will have to confirm), but then probably it'd be a good idea to edit
/etc/hosts
and assign host names to IPs this way
d
Having the same issue. I had to reinstall the OS to get it back to a connectable state. Fortunately I only did it for one node.
s
So, I configured all four nodes with a static IP today, and the only thing I did differently was to use Google's Public DNS IP in addition to mine. So, the DNS part of my dhcpcd.conf looks like this: static domain_name_servers=192.168.1.1 8.8.8.8 8.8.4.4
d
Wow! Can't believe that would have an impact.
s
It's the only thing I did differently
d
Can you share the sections of your .conf file that were edited?
s
# Example static IP configuration: interface eth0 static ip_address=192.168.1.112/24 #static ip6_address=fd51:42f8:caae:d92e::ff/64 static routers=192.168.1.1 static domain_name_servers=192.168.1.1 8.8.8.8 8.8.4.4
leave the IPV6 stuff commented out unless you plan on using it
d
Thank you. Yes, that is exactly what my changes looked like. Maybe I'll try using Google's DNS instead of Quad9 (DNS servers: 9.9.9.9 and 149.112.112.112). Thanks.
d
DNS server settings should not affect the network, so this is interesting. You should be able to connect to the nodes even without the DNS server set. The only downside will be the nodes won't be able to resolve domain names into the IPs
s
The side effects I was seeing were bizarre
And even now, the Kubernetes Cluster I installed is showing that the Server's IP is 127.0.0.1:6443
Even though the IP is set correctly
When I pinged my Turing Nodes from my desktop computer, each returned an IPV6 address, even though IPV6 has been disabled on my home router. I added a Static DNS entry to my home router referencing each Node's hostname and IPV4 address. Now when I ping the Nodes, I get an IPV4 return. So where'd it get the IPV6 address?
d
Not sure. Mine ping back with their static IP4 addresses. On that note, I think I realized my own brain fart when I set up static addresses. The default values for the IP address, static routers and DNS all have the third octet set to zero (192.168.0.1). I completely glanced over that and entered my static final octet on one or all of them, instead of setting it to my internal network's "1". 🤦‍♂️
s
Your desktop background might have contributed to that particular brain fart. (kidding) : )
p
Personally for the nodes themselves I use the dhcp from my router but have it assign a specific ip If you do it at the router level then you will continue to use dns that the rest of the network uses. For the Turing pi board itself with the release of 1.0.1 you can now set a file on an sdcard with the MAC address you want to use. So I have set that and again configured the router to only give a specific ip for that MAC address I do this for most of my network where I can and tend to use specific parts of the subnet for different types of devices. So my 2 Turing pies and nodes sit between 192.168.0.170 -192.168.0.179
47 Views