0

Yesterday I had tried to connect my RasPi 4b to ethernet (it was on wifi before). It didnt work so I tried to revert back to WiFi.

Now my static IP doesn't work. I tried editing /etc/dhcpcd.conf and it didnt work, I am now bummed and I don't know what else I could do. I know I am not describing my problem clearly but I cannot because I do not know why it stopped working. It all happened after I added dtoverlay=disable-wifi in /boot/config.txt (I removed it now). I am running Rasbian Buster Lite (I use the raspi as a web server and home NAS).

Series of events

I wanted to switch to ethernet. 
The ethernet cable did not work (status lights didnt turn on)
I thought maybe disabling WiFi would solve the problem
I added dtoverlay=disable-wifi in /boot/config.txt
It didnt work. I decided to not go further
I decided to switch back to WiFi
I removed dtoverlay=disable-wifi from /boot/config.txt
I rebooted. Pi didn't connect to WiFi
NEXT DAY:
Connected Pi to WiFi using raspi-config
Pi didn't have a static IP, one reboot its 192.168.0.31 then next reboot 192.168.0.32 and so on
I followed tutorials on how to set static ip again, didnt work.
I resorted to asking the rasperry pi forums

Contents of /etc/dhcpcd.conf:

interface wlan0
static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

Thanks in advance for your help.

Ingo
  • 42,107
  • 20
  • 85
  • 197
  • If you "read EVERY possible post about how to fix this and NONE worked" then no one can help unless you post some concrete data. Just restore from your backup! – Milliways Jul 03 '20 at 11:32
  • @Milliways I may have exaggerated too far when i said that but every post i found talked about editing /etc/dhcpcd.conf and I did that many times – corrupt_disk1 Jul 03 '20 at 11:40
  • Your Question still lacks meaningful data. If your network has a DHCP server attempting to set a static IP is almost always the wrong thing to do (this is a Raspberry Pi disease) and whatever you have done it is obviously not working. See How to set up networking/WiFi – Milliways Jul 03 '20 at 12:06
  • Don't use a static ip address. Revert everything to its default settings from the original image. Double check /etc/wpa_supplicant/wpa_supplicant.conf. Reboot your WiFi hotspot (internet router?). – Ingo Jul 04 '20 at 08:58
  • @Ingo That is a good suggestion but I need a static IP to be able to run a website or the port forwarding setting on the router will not connect to the Pi. I learnt that the IP will only change on a reboot so I turned to only rebooting my Pi once every 6 months or so just for security updates. I have decided to leave it as it is and not cause more problems, I would rather reset my port forwarding settings to match the PI's IP every 6 months than deal with another problem. Thanks so much for all your help! – corrupt_disk1 Jul 04 '20 at 11:01
  • Its possible that your router objects to the static IP - they are tied to the MAC address of the interface and the Ethernet one is different to the WiFi one. If possible I would remove the WiFi config (leaving just the Ethernet with the static IP details), then power cycle the router and see if that helps. You could also select a new IP address for the Ethernet link and try that. Unlike the good folk above - I put statics in both the router and the PI - I've had a 3 hour drive because the DHCP server failed at a remote site and could not get to anything after a power fail :-( –  Jul 04 '20 at 11:31

0 Answers0