Setting a manual IP address

May 14, 2024 Last reply: 2 years ago 31 Replies

What's the easiest way to manually set a RasPiOS host's IP address? Raspi-config offers DHCP or networkmanager, but neither invites manual intervention.



I've used DHCP up to now, but want to mess with a wireless ethernt bridge to see if I can improve my WiFi connectivity.



To do that I need to manually set the Pi address on the wired side so as to access the setup interface on the bridge.



If anybody's got pointers please post!



Thanks for reading,



bob prohaska


the best way if you have an internet router is to enable DHCP (the default) and set the fixed IP on the router

This may help:

formatting link

If you have a desktop use the NetworkManager to set your static IP. Click on the Up/Down Arrows on the -> Advanced Options -> Edit Connections, select the wired connection you want to change and then click the IPv4 tab and set a static IP address.

If you don't have a desktop use nmtui from the command line. It has a character interface similar to raspi-config. If you need further instructions on nmtui, post again.

What is the path to NetworkManager? It's present if I run it from the command line, but that doesn't bring up any dialogs, it only reports that it's running and turns off WiFi 8-(

Nmtui seems closer to what I was looking for. Basically I need to set a special IP, connect the bridge, log into the bridge and set it up using a browser, then either set a static IP or use DHCP.

I think you've got me on the correct foot, thank you!

bob prohaska

Do you have a desktop? A graphical display? NetworkManager is in the upper right corner. You open it by clicking on the up and down blue arrows. If you don't have a desktop see below:

Ok, got it 8-) I was looking under the raspberry icon at top left...

Thank you!

bob prohaska

Depends on the release. Every new release reinvents the networking wheel. There is a CLI interface to network manager (nmcli) that works pretty well

I stuck to that.

The traditional Debian way is to hand-edit /etc/network/interfaces. If an interface entry begins “interface «name» inet static”, then you can follow them with explicit settings, and NetworkManager should not touch them.

If you are using systemd-network (as Ubuntu does), then it is suffices to put config files named “«n»-«name».network»” in /etc/systemd/network, one for each interface, with manual settings in them. The format for these is documented in systemd.network(5).

[replying to lawrence]

The Pi in question is running a default RasPiOS version. Systemd shows up in dmesg output, but nothing from system-network.

Here's the experiment I'd like to try:

Right now, wlan0 comes up using DHCP and connects to my WiFi router, giving the usual net connectivity, which I'd like to keep active.

At the same time, I'd like to enable a second connection using an ethernet-to-WiFi bridge on eth0 using something like

auto eth0 iface eth0 inet static address 192.168.1.8/24 gateway 192.168.1.254

Is that all it takes? Presently both /etc/network/interfaces and /etc/network/interfaces.d are empty.

The plan is to bring up both interfaces, then turn off internal WiFi to see if eth0 is working. Both use the same default route. I'm simply trying to figure out if the bridge and its antenna can be situated for better throughput than the Pi4 internal antenna.

Thanks very much for posting!

bob prohaska

BookWORM screwed it all up - and not JUST the networking stuff.

Some months ago I posted some templates for the new, pointless, annoying, networking defs.

I think Deb is now employing Canonical REJECTS who have totally screwed up the distro to ZERO advantage.

On other units I've switched to Manjaro - but, to date, there's no Manjaro for the P5. Depending on what options you need, I'd suggest BeeLink and BMax mini-boxes instead of PIs.

The trashing of Debian is BAD ... as it's used as the foundation for SO many other (formerly) useful distros.

If you have a P4 or below you can still get older versions of Deb/PiOS ... but the P5 won't work with those.

Those files are used by ifupdown which is a package you can install. It's the Debian default even today but I don't think Raspios follows that. In fact, as I recall, earlier they had a strange hodgepodge script launched by the DHCP client and then I think they moved to NetworkManager.

So if you want specific help, always mention Raspios version.

Anyways, just adding stuff to /etc/network/interfaces isn't going to do anything and if you go and install ifupdown it might screw up your network setup. So I'd work with whatever you have and add the ethernet connection there. Or if it's just for experimentation all you need to do is to run ifconfig and route or the newer ip commands for same.

Yes. The latest release of PIOS (Bookworm) has many slight 'issues' and seems less well understood and documented and its all changed yet again. The reliable way to get fixed IP is to use network manager if you have a GUI and nmcli if you dont.

This is how its all set up, and although there may well be ways to fox it, you always run the risk that upgrades may overwrite the changes you made and f*ck everything up.

I can say that on my Pi4/Bookworm the nmcli route worked perfectly

I didn't realise how much until I tried a fresh install on a Pi 5.

I've no idea who they've employed, but it is going in a direction I don't want to follow.

There is a way around this. If you install the 64 bit version of Bullseye on a Pi 4, you can install the same set of packages copy your config files from the 32 bit version, making it work exactly the same.

You then ignore the dire warnings and do an in place upgrade to Bookworm. That then retains retains the previous style dhcpcd5 networking, and doesn't install Wayland etc.

The card can then be transferred to a Pi 5.

---druck

I cannot believe all the carp I am seeing here.

When bookworm came out, I did a fresh install on a pi4 - all good except for a minor glitch with Wayland. Soon fixed and it runs well.

When pi5 arrived, I copied to a USB SSD - all well from day 1. When I got an Argon ONE V3, with their NVME board it took a couple of goes, but with some help from the Raspberry forum it was soon well. Sill good now!

Well, uname -a reports: Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

I can't find anything that reports a plain-language name, and unfortunately don't remember what was installed/upgraded since the system was set up, apparently in 2022. The "about raspi-config" menu metions: Version: 20231012~bullseye but I'm not entirely sure that's the system name. If there's an "about this computer" command hidden somewhere please clue me in.

The intent for now is just experimentation, but internal WiFi performance has degraded noticeably in the last couple of years, I think because of interference. If adding an ethernet-wifi bridge with a bigger, moveable antenna helps I might want to make it permanent.

Thanks for the cautionary advice

bob prohaska

Debian doesn’t employ anyone, it’s all volunteers.

??? why not just install bookworm and then adjust it to taste. If you want ifupdown-style network configuration (which I do) you can just install it under bookworm, edit /etc/network/interfaces. No need to take aroundabout routes like installing bullseye and upgrading.

cat /etc/issue or lsb_release -a (from lsb-release package.)

/etc/issue is not more verbose than uname -a, but lsb_release says: Description: Debian GNU/Linux 11 (bullseye)

So, I guess it's bullseye.

Where does that leave me?

Thanks for writing,

bob prohaska

lsb_release -a

Reports the following on my intel desktop:

No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux trixie/sid Release: n/a Codename: trixie

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required