静态路由仍然使用错误的网关

静态路由仍然使用错误的网关

我有 2 台服务器连接到我们的公司局域网 (10.0.0.0\24),还连接到一个单独的局域网 (192.168.1.0\30)。我无法在 192.168.1.0 网络上从一台服务器 ping 另一台服务器,并且执行 tracert 显示第一跳是 10.0.0.226。以下是我们当前的路由表。路由就在那里。我遗漏了什么吗?

Ethernet adapter Migration:

   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 192.168.1.2
   Subnet Mask . . . . . . . . . . . : 255.255.255.252
   Default Gateway . . . . . . . . . :

Ethernet adapter vEthernet (Microsoft Network Adapter Multiplexor Driver -     Virtu
al Switch):

   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 10.0.0.2
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.0.0.226

Tunnel adapter isatap.{C8FB357B-225E-4F71-84A1-0B455B78D021}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{E1F1126B-0ED7-4DF3-BDD6-82DA53340448}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :


 ===========================================================================
 Interface List
  45...a0 36 9f 6d 0d e0 ......Microsoft Network Adapter Multiplexor Driver #2
  21...70 e2 84 06 d6 e9 ......Hyper-V Virtual Ethernet Adapter #2
   1...........................Software Loopback Interface 1
  14...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
  48...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
 ===========================================================================

 IPv4 Route Table
 ===========================================================================
 Active Routes:
 Network Destination        Netmask          Gateway       Interface  Metric
           0.0.0.0          0.0.0.0       10.0.0.226         10.0.0.1    261
          10.0.0.0    255.255.255.0         On-link          10.0.0.1    261
          10.0.0.1  255.255.255.255         On-link          10.0.0.1    261
        10.0.0.255  255.255.255.255         On-link          10.0.0.1    261
         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.1.0  255.255.255.252      192.168.1.1         10.0.0.1    261
       192.168.1.0  255.255.255.252         On-link       192.168.1.1    261
       192.168.1.1  255.255.255.255         On-link       192.168.1.1    261
       192.168.1.3  255.255.255.255         On-link       192.168.1.1    261
         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.1    261
         224.0.0.0        240.0.0.0         On-link       192.168.1.1    261
   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.1    261
   255.255.255.255  255.255.255.255         On-link       192.168.1.1    261
 ===========================================================================
 Persistent Routes:
   Network Address          Netmask  Gateway Address  Metric
           0.0.0.0          0.0.0.0       10.0.0.226  Default
           0.0.0.0          0.0.0.0       10.0.0.226  Default
           0.0.0.0          0.0.0.0       10.0.0.226     256
 ===========================================================================

 IPv6 Route Table
 ===========================================================================
 Active Routes:
  If Metric Network Destination      Gateway
   1    306 ::1/128                  On-link
  45    261 fe80::/64                On-link
  45    261 fe80::9df2:675b:7dac:43d7/128
                                On-link
   1    306 ff00::/8                 On-link
  45    261 ff00::/8                 On-link
 ===========================================================================
 Persistent Routes:
   None

其他系统

Ethernet adapter Migration:

   Connection-specific DNS Suffix  . :
   Autoconfiguration IPv4 Address. . : 192.168.1.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.252
   Default Gateway . . . . . . . . . :

Ethernet adapter vEthernet (Microsoft Network Adapter Multiplexor Driver - Virtual Switch):

   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 10.0.0.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.0.0.226

Tunnel adapter isatap.{C6D18C23-8682-48F7-91CA-29CBA7926666}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{B2032040-F6AE-467E-911C-9F72C77B0B51}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :



===========================================================================
Interface List
 24...78 2b cb 0a 63 67 ......Microsoft Network Adapter Multiplexor Driver #2
 23...78 2b cb 0a 63 65 ......Hyper-V Virtual Ethernet Adapter #2
  1...........................Software Loopback Interface 1
 16...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
 50...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0       10.0.0.226         10.0.0.2    261
         10.0.0.0    255.255.255.0         On-link          10.0.0.2    261
         10.0.0.2  255.255.255.255         On-link          10.0.0.2    261
       10.0.0.255  255.255.255.255         On-link          10.0.0.2    261
        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.1.0  255.255.255.252         On-link       192.168.1.2      7
      192.168.1.2  255.255.255.255         On-link       192.168.1.2    261
      192.168.1.3  255.255.255.255         On-link       192.168.1.2    261
        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    261
        224.0.0.0        240.0.0.0         On-link       192.168.1.2    261
  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    261
  255.255.255.255  255.255.255.255         On-link       192.168.1.2    261
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
          0.0.0.0          0.0.0.0       10.0.0.226  Default
          0.0.0.0          0.0.0.0       10.0.0.226     256
===========================================================================

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    306 ::1/128                  On-link
 24    261 fe80::/64                On-link
 24    261 fe80::4d95:7747:bd8f:81f5/128
                                    On-link
  1    306 ff00::/8                 On-link
 24    261 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None

答案1

看起来当您添加静态路由时,您将它添加到了机器 1 上的错误接口上。如果您不指定接口,Windows 会自己选择一个,我不确定它用什么来选择,但我从未见过它选择正确的接口。route delete 192.168.1.1应该这样做。

其次,机器 2 上有一个无效的静态路由。删除这两条路由(并且根本不使用静态路由)应该可以正常工作。

相关内容