我正在尝试(但失败了)设置以下网络情况:
我的 PC(运行 Windows 10)通过 Wi-Fi 连接到路由器。它通过 DHCP 获取所有网络设置,如下所示:
Wireless LAN adapter Wi-Fi:
Connection-specific DNS Suffix . : fritz.box
IPv4 Address. . . . . . . . . . . : 192.168.178.37
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.178.1
我还通过以太网将 PC 连接到一个小型 8 端口非托管交换机。另一台运行 Freenas 的 PC 也连接到该交换机。运行 Freenas 的系统具有静态 IP 192.168.0.100/24。我已将 PC 配置为具有静态 IP 192.168.0.50/24。
我曾希望 Windows 能够仅基于不同的子网访问我的服务器,但做不到。因此,我尝试在 Windows 中逐一设置以下路由:
route -p ADD 192.168.0.100 MASK 255.255.255.0 0.0.0.0 IF 12
route -p ADD 192.168.0.100 MASK 255.255.255.0 192.168.0.1 IF 12
route -p ADD 192.168.0.100 MASK 255.255.255.0 192.168.0.50 IF 12
如果 12 是我的以太网卡。即使有了这些路由,我还是无法访问服务器。
现在我感觉我的思维有一个基本错误。或者我只是忽略了一些东西?
顺便说一句,我无意将两个网络相互连接。我只想能够从我的普通 PC 访问互联网并同时连接到 NAS。
编辑(按要求):
有线连接的 ipconfig 输出:
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 192.168.0.50
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
“route print”的输出:
===========================================================================
Interface List
11...10 fe ed 1e c7 8b ......Microsoft Wi-Fi Direct Virtual Adapter #3
18...10 fe ed 1e c7 8b ......Microsoft Wi-Fi Direct Virtual Adapter #4
7...00 ff 42 f2 8d 7f ......TAP-Windows Adapter V9
3...10 fe ed 1e c7 8b ......Realtek RTL8192CU Wireless LAN 802.11n USB 2.0 Network Adapter
1...........................Software Loopback Interface 1
12...30 9c 23 7f ec a3 ......Realtek PCIe GBE Family Controller
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.178.1 192.168.178.222 306
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
169.254.0.0 255.255.0.0 192.168.178.37 192.168.178.222 51
192.168.0.0 255.255.255.0 On-link 192.168.0.50 356
192.168.0.50 255.255.255.255 On-link 192.168.0.50 356
192.168.0.255 255.255.255.255 On-link 192.168.0.50 356
192.168.178.0 255.255.255.0 On-link 192.168.178.222 306
192.168.178.222 255.255.255.255 On-link 192.168.178.222 306
192.168.178.255 255.255.255.255 On-link 192.168.178.222 306
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 192.168.178.222 306
224.0.0.0 240.0.0.0 On-link 192.168.0.50 356
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 192.168.178.222 306
255.255.255.255 255.255.255.255 On-link 192.168.0.50 356
===========================================================================
Persistent Routes:
Network Address Netmask Gateway Address Metric
169.254.0.0 255.255.0.0 192.168.178.37 1
0.0.0.0 0.0.0.0 192.168.178.1 Default
===========================================================================
我已从输出中删除了所有 IPv6 信息。