我有两个不同vlan上的两个网卡的Windows虚拟机。
NIC 1:10.243.237.167 / 27,gw -10.243.237.1 – vlan 10
网卡2:10.243.235.22/24,没有gw定义。 — vlan 11
现在,当我尝试在VLAN 11中ping /访问IP时,我无法这样做。 当我做一个跟踪,第一跳登陆到默认网关,而不是通过NIC 2退出。
然后我试图添加一个静态路由,我相信这不应该是必需的,那么它也使默认网关(10.243.237.1)作为第一跳。
静态路由:
netsh interface ipv4 add route 10.243.235.0/24 "PXE" 10.243.235.1
现在有趣的是,当我从VMware断开连接并重新连接网卡时,它开始在vlan 11上ping Ips,但是当我重新连接时,它再次失败。
所以我不确定永久解决这个问题需要做些什么。
添加静态路由后的路由表
Interface List 20...00 50 56 84 87 29 ......vmxnet3 Ethernet Adapter #2 11...00 50 56 84 38 ff ......vmxnet3 Ethernet Adapter 1...........................Software Loopback Interface 1 12...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter 13...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2 22...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
IPv4路由表
Active Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 10.243.237.161 10.243.237.167 261 10.243.235.0 255.255.255.0 10.243.235.1 10.243.235.22 6 10.243.235.22 255.255.255.255 On-link 10.243.235.22 261 10.243.237.160 255.255.255.224 On-link 10.243.237.167 261 10.243.237.167 255.255.255.255 On-link 10.243.237.167 261 10.243.237.191 255.255.255.255 On-link 10.243.237.167 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 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.243.237.167 261 224.0.0.0 240.0.0.0 On-link 10.243.235.22 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.243.237.167 261 255.255.255.255 255.255.255.255 On-link 10.243.235.22 261 Persistent Routes: Network Address Netmask Gateway Address Metric 0.0.0.0 0.0.0.0 10.243.237.161 Default 10.243.235.0 255.255.255.0 10.243.235.1 1
ipconfig / all输出:
C:\Users\Administrator>ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : ABC Primary Dns Suffix . . . . . . . : XYZ.com Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : XYZ.COM Ethernet adapter PXE: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : vmxnet3 Ethernet Adapter #2 Physical Address. . . . . . . . . : 00-50-56-84-87-29 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::443d:5c6a:4c1e:a713%20(Preferred) IPv4 Address. . . . . . . . . . . : 10.243.235.22(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : DHCPv6 IAID . . . . . . . . . . . : 335564886 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1E-E1-D2-6E-00-50-56-84-38-FF DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1 fec0:0:0:ffff::2%1 fec0:0:0:ffff::3%1 NetBIOS over Tcpip. . . . . . . . : Enabled Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : vmxnet3 Ethernet Adapter Physical Address. . . . . . . . . : 00-50-56-84-38-FF DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::d84e:9a5:16cc:b2d3%11(Preferred) IPv4 Address. . . . . . . . . . . : 10.243.237.167(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.224 Default Gateway . . . . . . . . . : 10.243.237.161 DHCPv6 IAID . . . . . . . . . . . : 184569942 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1E-E1-D2-6E-00-50-56-84-38-FF DNS Servers . . . . . . . . . . . : 10.169.66.196 10.169.194.196 NetBIOS over Tcpip. . . . . . . . : Enabled Tunnel adapter isatap.{AF767DF7-D092-437C-B120-5D0A59C1D8E0}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft ISATAP Adapter Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap.{7F24A98F-1CF1-4B00-B313-C2064AC12285}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2 Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap.{6C943185-2420-454E-AFFC-3206CB9640E6}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3 Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes
静态路由是不需要的; 如果服务器在10.243.235.0/24networking上有networking接口,则应该已经知道如何到达该networking。
此外,您的静态路由是错误的:它告诉服务器通过网关10.243.235.1到达10.243.235.0/24networking,这是不可能的,因为网关的IP地址是在同一个networking中其实我很惊讶这个命令甚至被接受了)。
这里缺less的是一条path,告诉服务器可以通过其IP地址为10.243.235.22的接口到达10.243.235.0/24networking:
10.243.235.22 255.255.255.0 On-link 10.243.235.22 261
但不应该手动configuration,因为具有与该IP地址和子网掩码的networking接口的事实应该自动设置它。
请添加ipconfig /all的输出,以便检查networkingconfiguration中是否有问题。