I THINK I "need" my Pi to use a static IP. I am building a web-server in a home environment. It will be on my LAN, accessible to WAN via the magics of NAT and DYNDNS. Without a static IP, how does NAT know where to redirect incoming packets for the port I've chosen for the server?
If I turn off Pi's Wi-Fi, connect my Pi via a cable, and let the router assign the device its local IP address (LIPA) with the router's DHCP service, then I can ping the Pi across the LAN, and access google.com with Chrome.
But when I try to use the Pi's Wi-Fi with a static IP:
no joy with ping...
even though when I hover the mouse over the "network" icon on the Pi's screen (which has changed from up arrow/down arrows to signal strength indicator), I do see
wlan configured 192.168.0.190/24
... which is where I asked it to be. (For others reading this who don't know: The /24 says "subnet mask 255.255.255.0")
I don't think I've "messed with" anything other than /etc/.dhcpcd.conf
I'm doing this forum post "by hand" on a neighboring computer... the following could have typos... but I don't think I did more than add...
Code: Select all
interface wlan0 static ip address=192.168.0.190/24 static routers=192.168.0.1 static domain_name_servers=22.214.171.124 126.96.36.199
Is the next thing to try changing BOTH wlan0 AND eth0 to the static spec I want? I was hoping that I could "swap" between WORKING "by cable, but DHCP-assigned-LIPA" and not-yet-working "by LIPA, static IP".
DO I "need" Static IP, or is there another way? HOW do I get it working, if I do?....