RPi Static IP

I've never cared much for Linux, and have never had a job that used it as part of a primary role, nor would I take one. However, I have been using it on and off for around 20 years. In fact I'm running Slackware 24x7 in my own home right now. The distro you're using is nothing like any of them with respect to assigning a static IP. So I went over to the Hass pages, and to be honest I can't believe some of the stuff I've read. If there were a poster child for the reason I don't like Linux, this OS would be it according to what I've read. I'll reserve my specific negative opinions of it, but let's just say if I didn't have legs I'd rather drag my body across a floor and up 10 flights of stairs using my teeth to flip a light switch using my belt than use the Homeseer product after reading what I read about the Hass OS. But it sure looks like a great toy for those that have the time and the inclination. I'll stick to Hubitat, thanks.

So with the assumption that often times nothing is as bad as it seems, I have to ask. How should I set a static IP on the CDVR RPi image using the least number of keystrokes, assuming nothing is in place beyond writing the image and inserting it into the Pi?

I would also like to suggest that those steps be included somewhere in the supporting doc for the image. This is not an enterprise OS, so most people don't know how to do it, and probably don't care. They certainly don't want to do the backstroke in the needless minutia found in the Hass docs.

It’s not an answer to your question but I would suggest using a static DHCP reservation. To me it ends up being way less work than managing client settings and gives you a central place to keep all static IPs organized. Just a thought.

Linux is used everywhere, biggest thing is embedded systems, like POS etc. but also enterprise servers for many things.
MacOS is based on Unix. So things non Windows are every where in the IT field.
Anyways, back to your question

But, if you are not comfortable with Linux, you are free to install Channels DVR server on other supported devices.

I do find setting per device static IPs a pain, and use my routers DHCP Static router/ Reservation instead. does same thing and easy to mange.

The OS on that image uses NetworkManager. NetworkManager has a manpage with many examples. Scroll down to example 11, which describes how to create a new connection with a static IP:

$ nmcli con add con-name my-con-em1 ifname em1 type ethernet \
  ip4 192.168.100.100/24 gw4 192.168.100.1 ip4 1.2.3.4 ip6 abbe::cafe
$ nmcli con mod my-con-em1 ipv4.dns "8.8.8.8 8.8.4.4"
$ nmcli con mod my-con-em1 +ipv4.dns 1.2.3.4
$ nmcli con mod my-con-em1 ipv6.dns "2001:4860:4860::8888 2001:4860:4860::8844"
$ nmcli -p con show my-con-em1

Below the example is a more detailed description.

(Edit: updated the manpage link to point to the nmcli-examples (5) manpage hosted by NetworkManager rather than Arch's slightly outdated version.)

2 Likes

What os is it base don , I just assumed Pi OS lite due to it having the same config setup

It does not. The proper link should be to NetworkManager.

If you read the posts about the image, you'd know that it is a minimal OS modeled on the hass.io image for the standalone install of HomeAssistant.

1 Like

I'm not setting static IPs at the firewall. I just need the steps to set it on this image. FYI, the doc on RasOS doesn't work either. The files referenced don't even exist on this image.

From the original post announcing the image (BETA: Channels DVR Server for Raspberry Pi 4 (USB BOOT IMAGE), emphasis added):

Our RPI4 image is based on an ARM64 embedded linux distribution, and has been optimized to fully take advantage of the Pi4 CPU and GPU including transcoding for remote viewing. Thanks to our friends at home-assistant.io and their HassOS for the inspiration.

My quick reading of that line led me to think that since it says inspired by...not actuly used their os. lol. :stuck_out_tongue_winking_eye: ooops my bad. ill shut up now.

i've been messing with many distro's for pi the last couple weeks, including channels dvr and emby distros, so...sorry, i got things a bit mixed up.

nmcli is the way to setup static IP or Wi-Fi.

I was looking all over the place for a file to edit. THANK YOU!

...but doesn't this just write to a text file somewhere? That's how I've been doing it for the last 14 years. I've pretty much been working with RHEL at work, and CentOS at home. There it's just vi /etc/sysconfig/network-scripts/ifcfg-****

Oh, and FYI the reason I wanted to set it at the device instead of the firewall is currently this is the only device set at the firewall, but I'm evaluating a replacement for PFSense. So that would mean I'd have to set it every time I boot the machine to a new distro and with OpnSense it created a problem. Pfsense allows you to assign any static IP to a dhcp device. The ip being used was outside the DHCP pool, and PFsense was fine with that. OpnSense choked on it. They require your static IP assigned at the firewall be within the DHCP pool. That's what started this mess. Well, what really started it is my first Channels server was a Docker with a static IP. It was either modify all my m3u files or keep the ip.

...and the reason for putting in OpnSense is it natively supports WireGuard. WireGuard will be going on my portable TV Box, and that setup will allow me to plug in and easily watch tv from anywhere without any hassles.

***Edited to correct product name. It's not "WatchGuard", it's "WireGuard". One of these days I'll get 8 hours sleep again.

1 Like

Yes. Each connection gets its own file. I'm not sure where they're stored for the Channels image, but on my laptop, they're in /etc/NetworkManager/system-connections.

If you're interested in manually creating such a connection, check out NetworkManager.conf (5).

1 Like