两个 Wi-Fi 网络争夺 IP 地址

两个 Wi-Fi 网络争夺 IP 地址

我的笔记本电脑上目前有两个 Wi-Fi 适配器。

  • 优先级最高的那个连接到我手机的 Wi-Fi 网络共享,并且我被分配了一个动态 IP 地址,通常在 192.168.43.5 左右。(IP 地址和子网配置无法更改,因为这是一部未 root 权限的手机。)
  • 我的第二个网络是专用的 LAN。目前,它的子网掩码为255.0.0.0(我最好的猜测)和默认网关10.0.0.1

不幸的是,有时我的手机会重定向到托管在1.1.1.1或者1.1.1.2。发生这种情况时,某些网站上的图片将无法加载。当我尝试打开图片时,我被带到我的 LAN 路由器的配置页面,托管在 10.0.0.1。

这里有些不对劲。我该如何设置 LAN 路由器的 IP 地址分配和子网掩码,以免干扰我的 Wi-Fi 热点?网上关于这方面的信息很少,即使我搜索有关私有子网掩码的信息也是如此。

我的本地网络配置如下:

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::d4d6:b65b:6db4:9630%12
   IPv4 Address. . . . . . . . . . . : 192.168.43.5
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.43.1

Wireless LAN adapter Wi-Fi 2:

   Connection-specific DNS Suffix  . : Belkin
   Link-local IPv6 Address . . . . . : fe80::44e5:80c3:809e:2055%40
   IPv4 Address. . . . . . . . . . . : 10.0.0.2
   Subnet Mask . . . . . . . . . . . : 255.0.0.0
   Default Gateway . . . . . . . . . : 10.0.0.1

加载图像时,我的 URL 通常如下所示:

1.1.1.2/bmi/readwrite.com/files/styles/630_0su/public/fields/shutterstock_118925992.jpg

对其进行 tracert 得到以下结果(它转到错误的本地路由器:

Tracing route to 1.1.1.2 over a maximum of 30 hops

  1     2 ms     1 ms     1 ms  router.belkin [10.0.0.1]
  2  router.belkin [10.0.0.1]  reports: Destination net unreachable.

根据要求,我的“路线打印”输出:

===========================================================================
Interface List
 12...a4 17 31 de 96 0f ......Qualcomm Atheros AR9485WB-EG Wireless Network
ter
 40...ec 1a 59 0f 94 29 ......Surf Wireless Micro USB Adapter
 39...00 ff 56 0f 3f e2 ......TAP-Windows Adapter V9
 34...02 00 54 74 68 72 ......EasyTether Network Adapter
 22...00 26 37 bd 39 42 ......PdaNet Broadband Adapter
 13...54 53 ed 37 9c 49 ......Realtek PCIe GBE Family Controller
  1...........................Software Loopback Interface 1
 15...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
 18...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
 25...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #7
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     192.168.43.1     192.168.43.5     25
          0.0.0.0          0.0.0.0         10.0.0.1         10.0.0.2     25
         10.0.0.0        255.0.0.0         On-link          10.0.0.2    281
         10.0.0.2  255.255.255.255         On-link          10.0.0.2    281
   10.255.255.255  255.255.255.255         On-link          10.0.0.2    281
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
     192.168.43.0    255.255.255.0         On-link      192.168.43.5    281
     192.168.43.5  255.255.255.255         On-link      192.168.43.5    281
   192.168.43.255  255.255.255.255         On-link      192.168.43.5    281
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link          10.0.0.2    281
        224.0.0.0        240.0.0.0         On-link      192.168.43.5    281
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link          10.0.0.2    281
  255.255.255.255  255.255.255.255         On-link      192.168.43.5    281
===========================================================================
Persistent Routes:
  None

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
 18    306 ::/0                     On-link
  1    306 ::1/128                  On-link
 18    306 2001::/32                On-link
 18    306 2001:0:9d38:6abd:d8:f97:3f57:d4fa/128
                                    On-link
 40    281 fe80::/64                On-link
 12    281 fe80::/64                On-link
 18    306 fe80::/64                On-link
 15    281 fe80::5efe:10.0.0.2/128  On-link
 25    286 fe80::5efe:192.168.43.5/128
                                    On-link
 18    306 fe80::d8:f97:3f57:d4fa/128
                                    On-link
 40    281 fe80::44e5:80c3:809e:2055/128
                                    On-link
 12    281 fe80::d4d6:b65b:6db4:9630/128
                                    On-link
  1    306 ff00::/8                 On-link
 18    306 ff00::/8                 On-link
 40    281 ff00::/8                 On-link
 12    281 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None

答案1

您必须删除两个默认路由,然后重新建立所需的路由(通过 192.168.43.1)作为“唯一”默认网关。在终端中,输入:

route delete 0.0.0.0
route delete 0.0.0.0
route add 0.0.0.0 mask 0.0.0.0 192.168.43.1 metric 1

为了使此操作永久生效,请在最后一个命令中将路由替换为路由 -p

相关内容