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

Networking and servers • Re: Assistance with script to change Static IP

$
0
0
For bookworm, on my home network, I have simply copied something like this:

Code:

allow-hotplug eth0iface eth0 inet staticaddress 192.168.0.XXX/24netmask 255.255.255.0gateway 192.168.0.1
to /etc/network/interfaces.d/eth0
Which has always worked perfectly and is trivial in a bash script.
Most importantly, you can do it prior to the first boot (how do you do that with nmcli by the way ?)

No doubt someone will explain why that's wrong ....
I believe that /etc/network/interfaces.d has been on the deprecated list for a few years now. Since NetworkManager processes whatever is in there, my guess is that it's not going to go away any time soon, but who knows?

And, of course, you can use sdm to stuff files into /etc/network/interfaces.d (yes, I had to mention that ;) )

Statistics: Posted by bls — Sun Sep 15, 2024 9:48 pm



Viewing all articles
Browse latest Browse all 4785

Trending Articles