Linux之虚拟机配置双网卡

首先检查本地windows 是否有新的HOST-ONLY网卡

vim /etc/sysconfig/network-scripts/ifcfg-enp0s3
DEVICE=enp0s3
TYPE=Ethernet
BOOTPROTO=dhcp
ONBOOT=yes
NM_CONTROLLED=no

vim /etc/sysconfig/network-scripts/ifcfg-enp0s8
DEVICE=enp0s8
TYPE=Ethernet
BOOTPROTO=static
ONBOOT=yes
NM_CONTROLLED=no
IPADDR=192.168.99.153
GATEWAY=192.168.99.1 (取决于HOST-ONLY的网段)

sudo vim /etc/sysconfig/network-scripts/route-enp0s8
192.168.99.0/24 via 192.168.99.1 dev enp0s8


vim /etc/sysconfig/network
NETWORKING=yes
GATEWAYDEV=enp0s3

你可能感兴趣的:(Linux)