简体   繁体   English

如何使用 static IP 修复 Android“已连接但没有互联网”?

[英]How to fix Android "Connected but no internet" with static IP?

I have set up a Pi-Hole, but my router doesn't allow setting it as global preferred DNS, so I have to set it for all my devices manually.我已经设置了一个 Pi-Hole,但我的路由器不允许将其设置为全局首选 DNS,因此我必须为我的所有设备手动设置它。

So I go to Android WiFi settings (Android 11), and set Static IP所以我 go 到 Android WiFi 设置(Android 11),并设置 Static ZA12A3079E14CED461EAZ69

  • My default assigned IP was 192.168.0.115, so I leave that as is我默认分配的 IP 是 192.168.0.115,所以我保持原样
  • Default gateway was 192.168.1.1, also left as is默认网关是 192.168.1.1,也保持原样
  • DNS 1 I changed to my PiHole IP (which works from my desktop) DNS 1 我更改为我的 PiHole IP(在我的桌面上工作)
  • DNS 2 left blank DNS 2 留空

I get "Connected but no internet" status, even if I change DNS 1 to Google (8.8.8.8) or Cloudfare (1.0.0.1).即使我将 DNS 1 更改为 Google (8.8.8.8) 或 Cloudfare (1.0.0.1),我也会获得“已连接但没有互联网”状态。 Turning on/off cellular data doesn't help either.打开/关闭蜂窝数据也无济于事。

What could be causing this?这可能是什么原因造成的? How can I set custom DNS server when connected to this network?连接到此网络时,如何设置自定义 DNS 服务器?

Your network settings seem strange.您的网络设置看起来很奇怪。 The default gateway must be on the same subnet as the IP address - in typical home setups, the subnet mask is /24 and so the third octets of the IP addresses should be identical.默认网关必须与 IP 地址位于同一子网中 - 在典型的家庭设置中,子网掩码为/24 ,因此 IP 地址的第三个八位字节应该相同。 You don't mention what you have the subnet set to, and you have 0 for the third octet of the IP address and 1 for that of the gateway.您没有提及您将子网设置为什么,并且 IP 地址的第三个八位字节为0 ,网关的地址为1 Are you sure that's correct?你确定这是正确的吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM