I have an old raspberry pi that I haven’t used for several years and I just reconnected it. It started fine and I could connect it to my wifi but I just saw its ipv6 address. So I couldn’t connect to the internet or even other devices on my local. I had to run this command to get an ipv4 address:
sudo dhclient -v wlan0