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.

wall03
  • 11
  • 1
    What is a "permenant(sic) LAN address"? What have you tried? See [How to set up networking/WiFi](https://raspberrypi.stackexchange.com/a/37921/8697) – Milliways Mar 02 '21 at 00:38
  • One that doesn't change every time the router wants it to. @Milliways – wall03 Mar 02 '21 at 00: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 Mar 04 '21 at 18:23

2 Answers2

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 zeus@buster-raspi.local
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.

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • real noob here, how do I add to a file? – wall03 Mar 02 '21 at 00: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 Mar 02 '21 at 00:50