No internet when on WiFi when on static IP

I run my DietPi setup as an NAS. To connect it to the router and the rest of the network, I use TP-Link’s WN725N WiFI mini-dongle. Ethernet is absolutely not an option due to the space organization.

Now, if I set a static local IP address to DietPi, the Internet doesn’t work. No apt-get, no dietpi-update, nothing but samba, ssh and other local-network protocols. But when i do

dhclient

the internet link sprouts to life, BUT the Pi loses its static IP and gets assigned a DHCPed one by the router. Since I have mapped the NAS drives on a few networked devices, that won’t do.

How to get both the Internet access and the static local IP?

On my router one of the settings is to assign a fixed IP address by mac address / hostname, so whilst it’s dhcp that’s assigning IP addresses my pi always ends up with the same one.

Not sure if you have that option but it may be worth a try?

No, my router has no options like that. I can enable, disable or relay DHCP, set starting IP address, pool count etc. That’s it.

But my understanding is if the connected device has its own static IP address, the router will let it use it regardless of the DHCP status. And that is what happens, it’s just it works on the local network exclusively, for reasons unknown to me.

Hi,

Could be potential bug, could you please run dietpi-bugreport and follow the onscreen instructions. This will allow me to look into your system/settings and attempt to resolve the issue your experiencing.

If you can verify the internet is working before running dietpi-bugreport (either by running your dhclient fix , or set to DHCP) . This will ensure the bug report gets uploaded.

Thanks

Did it. Thank in advance, Fourdee.

Thanks. I’ve sent you an email.

Something really weird is going on…

I have TWO local IPs on a single WiFi adapter (first available DHCP and the static IP).

This is the NoIP-setting, listing both interfaces, while ifconfig gives just the static IP address on wlan0. Both work thru SSH, in parallel.

I’ve done nothing but dhclient fix, and this is the first time this happened.

More importantly, the Internet is reachable, but I can’t update via dietpi-update command, the req 404’s.

Hi,

Can you send me another dietpi-bugreport please (no need to fill out the info, just paste the reference code).

dietpi-bugreport

Ref code

 b827eb3ef05b-1

Thanks,

As i suspected, looks like your settings are corrupt due to power loss. This was a known issue with v77. Please see this link for information and follow the instructions.

Once you have completed the above, see if the issue still occurs.

Hi,

I successfully updated to v79. Dual IP case seems to be no more, but the original problem of having no Internet access is still there. Only thing left is to try a fresh image flashing and that will take some self-convincing.

Thanks for everything, Fourdee.

Hi,

I ran a test today on my RPI with static wifi ip, was unable to replicate the issue. I’ve checked through your network settings.

The only thing i can see might be wrong is your gateway:
gateway 192.168.100.53
Unless you have specified this in your router lan settings, this should be 192.168.*.1.

I would recommend you try the following to copy the working IP addresses from DHCP:

  • Run dietpi-config 8
  • goto the Wifi Menu
  • change from STATIC to DHCP and select "Apply Save Changes (Restart Networking)"
  • Now your setup with the working DHCP ip address, you can use “Copy Copy Current address to Static”, then change to STATIC and save again “Apply Save Changes (Restart Networking)”.

Hi, Dan. No, that’s proper, it’s not an error.

I’ll give it a go. Just to rectify my previous post, dual IPs are still here ater the v79 update. It’s not a problem, it’s not giving me any issues, only something I wanted to mention.
I’ll try and find the time over the w-end to do a fresh install of DietPi and cross my finger that’ll solve the issues.