20180319- two-card computer while on the internal and external network

Windows

  • Wireless card to connect your phone hotspot
  • The wired LAN connection Router

Finally get (simple configuration can)

Or check the internet to facilitate

  • Network card: manually configure the IP address and subnet mask, remove the gateway.
  • External network card: You can get DHCP can also be manually configured (IP address, subnet mask, gateway, DNS must be configured)

basic situation


PC Configuration

rout print /4

  • The problem is that there are two gateways to point 0.0.0.0, so routing can conflict, both networks will appear to access the conflict, we need to manually configure the routing
# 删除所有指向0.0.0.0
route delete 0.0.0.0
# 添加访问内网网段的,走192.168.1.1网关,方便下次配置可以 -p(这个不行)
route add 192.168.1.0 mask 255.255.255.0 192.168.1.1 if 14
# 添加访问外网网段的,走那个网关,由于是手机热点,这个应该会经常变化
route add 0.0.0.0 mask 0.0.0.0 172.20.10.1 if 15
# 这个添加为永久(不行)
route add -p 192.168.1.0 mask 255.255.255.0 192.168.1.1 if 14
  • In the current exceptional circumstances, you can add a separate route for my linux server
# 这个就行了
route add 192.168.1.108 mask 255.255.255.255 192.168.1.1 if 14
  • But the question now is, PC now can ping 192.168.1.108, namely notebooks, but still can not establish ssh, linux later found to be unable to ping 192.168.1.109

Configuring Linux

# 查看路由表
route -n
# 看完之后,感觉应该不是Linux配置的问题,而是windows的问题。

Comparison of single and dual card NIC routing table

Guess you like

Origin www.cnblogs.com/lizhensheng/p/11117123.html