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

Beginners • Static IP Driving Me Nuts

$
0
0
I have a Pi Zero W that was sitting in bin for a few years. I decided to use it on a project. I installed Raspberry Pi OS Lite (32-bit), with no desktop environment (released 2024-03-15) from the Pi Imager. This little Zero W will be running some Python scripts and I need it to have a static IP.

As installed, it is using DHCP and has access to the whole network and Internet - I can ping devices anywhere including 1.1.1.1.

I created a file: /etc/network/interfaces.d/wlan0

which contains:

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.11
network 192.168.1.0
netmask 255.255.255.0
gateway 192.168.1.1

and rebooted the Pi.

When it comes back up, ifconfig shows the correct static IP address. However, I cannot even ping 192.168.1.1. I get "destination host unreachable" when pinging.

If I delete the wlan0 file and reboot, all returns to normal under DHCP.

What am I missing?

Statistics: Posted by ka2irq — Sun Apr 28, 2024 10:30 pm



Viewing all articles
Browse latest Browse all 5368

Trending Articles