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

Beginners • Re: Static IP issues, instructions on the net dont work

$
0
0
To set a static address in advance (after writing the OS image):
Create a file called "eth0" in rootfs ... "/etc/network/interfaces.d" containing something like this:

Code:

allow-hotplug eth0iface eth0 inet staticaddress 192.168.0.XX/24netmask 255.255.255.0gateway 192.168.0.1

While this will work be aware that Network Manager will ignore that interface from then on. Plus:
  • You probably don't need the "/24" in "address 192.168.0.XX/24".
  • You do need to use the correct subnet.
  • You do need to use an IP address in that subnet but outside the range used by your DHCP server.
or configure the router if possible.

Which is definitely the better way to do it. Unless you plan on using the same SD card with different physical Pi.

Statistics: Posted by thagrol — Fri Jan 19, 2024 10:04 pm



Viewing all articles
Browse latest Browse all 4792

Trending Articles