Liunx和windows 双网卡配置其中一个网卡访问固定的IP

liunx 双网卡添加路由

#1. 首先将 enp8s0 的默认网关删除

route del default enp8s0

#2. 在将 需要访问的目标主机 host=111.229.248.28 添加到网卡 enp8s0 中

route add -net 111.229.248.28 netmask 255.255.255.255 gw 192.168.2.1 enp8s0

#3. 验证

ping -I enp8s0 111.229.248.28

window 双网卡添加路由

#windows10,  9 是网卡的序号
route print #查看路由表信息 route add
117.60.62.200 mask 255.255.255.255 192.168.2.1 if 9
原文地址:https://www.cnblogs.com/han-guang-xue/p/14500842.html