0

I want my Pi to have a permanent IP when accessing via LAN (i.e. http://192.168.1.10/, not the web), so I don't have to search for it every time. My router settings will not allow me to do this (It's an ISP provided, with limited settings).

I have my Pi 3B running Raspbian Lite.

3
  • 1
    What is a "permenant(sic) LAN address"? What have you tried? See How to set up networking/WiFi
    – Milliways
    Commented Mar 2, 2021 at 0:38
  • One that doesn't change every time the router wants it to. @Milliways
    – wall03
    Commented Mar 2, 2021 at 0:40
  • What you mean is a static ip address. You have an internet router and the Raspberry Pi on your network. What are the other devices? What operating system they are running?
    – Ingo
    Commented Mar 4, 2021 at 18:23

2 Answers 2

1

Use the hostname as a means to eliminate an IP change messing you up. You just put the .local on it so it will search on the local network for that host.

MacUser2525:~$ ssh [email protected]
Linux buster-raspi 5.9.0-0.bpo.5-arm64 #1 SMP Debian 5.9.15-1~bpo10+1 (2020-12-31) aarch64
snip...
Last login: Mon Mar  1 17:54:07 2021 from fe80::1003:5492:80fa:2bc5%eth0
0

If you want your Pi to be assigned a predictable IP Address you can request the DHCP server to assign one.
E.g. Adding the following to /etc/dhcpcd.conf will request an address on wlan0 and on eth0.

interface wlan0
request 192.168.1.99

interface eth0
request 192.168.1.98

If you request an IP Address within the range managed by the DHCP server which is available this should be honoured, otherwise the DHCP server will allocate an address as normal.

2
  • real noob here, how do I add to a file?
    – wall03
    Commented Mar 2, 2021 at 0:47
  • You will have to learn how to edit system files. Most use something like sudo nano /etc/dhcpcd.conf I prefer sudoedit /etc/dhcpcd.conf (which is safer), but not sure if this requires other configuration. I suggest you practice editing on some other files. ALWAYS make a copy BEFORE editing ANY system file.
    – Milliways
    Commented Mar 2, 2021 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.