C:\Documents and Settings\Administrator>route print
IPv4 Route Table
Interface List 0x1
........................... MS TCP Loopback interface 0x10003
...00 14 22 10 7f ea ...... Intel(R) PRO/1000 MT Network Connection #2 0x10004
...00 14 22 10 7f e9 ...... Intel(R) PRO/1000 MT Network Connection
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.12.199 192.168.12.39 10
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.12.0 255.255.255.0 192.168.12.39 192.168.12.39 10
192.168.12.39 255.255.255.255 127.0.0.1 127.0.0.1 10
192.168.12.255 255.255.255.255 192.168.12.39 192.168.12.39 10
224.0.0.0 240.0.0.0 192.168.12.39 192.168.12.39 10
255.255.255.255 255.255.255.255 192.168.12.39 10003 1
255.255.255.255 255.255.255.255 192.168.12.39 192.168.12.39 1
Default Gateway: 192.168.12.199
Persistent Routes: None
C:\>route -p add x.x.x.x mask 255.255.255.255 192.168.96.199
The route addition failed: Either the interface index is wrong or the gateway
does not lie on the same network as the interface.
Check the IP Address Table for the machine.
我无法添加上述路由。为什么?
答案1
我假设 xxxx 是您为了保密而替换的内容,并且是原始命令中的正确 IP 地址。
192.168.96.199 在不同的网络上,网关必须位于同一网络上。
您的本地网络掩码可能是正确的(子网 192.168.12.0 的掩码为 255.255.255.0)
您确定网关的第三个八位字节(96 而不是 12)是正确的吗?