Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 2526

Raspberry Pi OS • Re: Static IP with Bookworm

$
0
0
I have a few Pis plugged into a switch, for tinkering. There is no router.

Prior to bookworm, I would add some lines to /etc/dhcpcd.conf

Code:

# example ip addressesinterface eth0        static ip_address=10.0.0.100/8        static routers=10.0.0.1        static domain_name_servers=10.0.0.1
To learn more about the "old" way, read the man pages : man dhcpcd

Bookworm
Since bookworm, the configuration has moved. Now we need to create a new file at /etc/network/interfaces.d/eth0

Code:

allow-hotplug eth0iface eth0 inet staticaddress 10.0.0.100network 10.0.0.0netmask 255.255.255.0gateway 10.0.0.1
To learn more about the "new" system, read the man pages : man interfaces

I landed here from a google search, it was IIRC one of the top results. I had to do a lot of extra googling to find the answer, so hopefully this helps future tinkerers-sans-router :)

Statistics: Posted by wbit — Sun Feb 04, 2024 2:12 am



Viewing all articles
Browse latest Browse all 2526

Trending Articles