我有两个网络适配器:
适配器1: Realtek PCIe GBE Family Controller
ip:10.0.3.27
适配器2: Dell Wireless 1397 WLAN Mini-Card
ip:192.168.2.39
两个网络适配器都可以访问互联网。无需任何配置,适配器 1 便可用于通过局域网和互联网进行通信。
我想使用适配器 1 仅通过我的局域网进行通信,并使用适配器 2 通过互联网网络进行通信。
有人说我必须使用命令route
来改变路由表,但我不清楚我必须删除哪些条目以及必须添加哪些(静态路由?!?)。
这是我使用命令获得的路由表route print
:
===========================================================================
Elenco interfacce
13...0c ee e6 9c 24 2e ......Dell Wireless 1397 WLAN Mini-Card
22...0c ee e6 9c 24 2e ......Microsoft Virtual WiFi Miniport Adapter
20...00 05 9a 3c 78 00 ......Cisco Systems VPN Adapter for 64-bit Windows
11...00 24 e8 ec c9 51 ......Realtek PCIe GBE Family Controller
1...........................Software Loopback Interface 1
24...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
===========================================================================
IPv4 Tabella route
===========================================================================
Route attive:
Indirizzo rete Mask Gateway Interfaccia Metrica
0.0.0.0 0.0.0.0 10.0.3.1 10.0.3.27 10
0.0.0.0 0.0.0.0 192.168.2.1 192.168.2.39 25
10.0.3.0 255.255.255.0 On-link 10.0.3.27 266
10.0.3.27 255.255.255.255 On-link 10.0.3.27 266
10.0.3.255 255.255.255.255 On-link 10.0.3.27 266
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
169.254.0.0 255.255.0.0 On-link 169.254.230.75 276
169.254.230.75 255.255.255.255 On-link 169.254.230.75 276
169.254.255.255 255.255.255.255 On-link 169.254.230.75 276
192.168.2.0 255.255.255.0 On-link 192.168.2.39 281
192.168.2.39 255.255.255.255 On-link 192.168.2.39 281
192.168.2.255 255.255.255.255 On-link 192.168.2.39 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 169.254.230.75 276
224.0.0.0 240.0.0.0 On-link 192.168.2.39 281
224.0.0.0 240.0.0.0 On-link 10.0.3.27 266
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 169.254.230.75 276
255.255.255.255 255.255.255.255 On-link 192.168.2.39 281
255.255.255.255 255.255.255.255 On-link 10.0.3.27 266
===========================================================================
Route permanenti:
Nessuna
IPv6 Tabella route
===========================================================================
Route attive:
Interf Metrica Rete Destinazione Gateway
1 306 ::1/128 On-link
20 276 fe80::/64 On-link
20 276 fe80::2d03:d120:4de1:e64b/128
On-link
1 306 ff00::/8 On-link
20 276 ff00::/8 On-link
===========================================================================
Route permanenti:
Nessuna
答案1
你的问题是
0.0.0.0 0.0.0.0 10.0.3.1 10.0.3.27 10
0.0.0.0 0.0.0.0 192.168.2.1 192.168.2.39 25
这意味着所有未被其他路由处理的流量都被路由到两个网关,首先路由较低的指标,在本例中为 10.0.3.1。
要通过 192.168.2.1 网关路由所有流量,请以管理员身份打开命令提示符并运行
route delete 0.0.0.0
route add 0.0.0.0 MASK 0.0.0.0 192.168.2.1 IF 13