给虚拟机添加eth1网络适配器(网卡)

1.虚拟机 — > 设置

给虚拟机添加eth1网络适配器(网卡)

2.添加 –> 网络适配器 –> 下一步

给虚拟机添加eth1网络适配器(网卡)

3.主机 — > 完成 — > 确定

给虚拟机添加eth1网络适配器(网卡)

4.修改网卡的配置文件

[root@tiejiang ~]# cd /etc/sysconfig/network-scripts
[root@tiejiang network-scripts]# cp ifcfg-eth0 ifcfg-eth1
[root@tiejiang network-scripts]# vi ifcfg-eth1
DEVICE=eth1
IPADDR=192.168.**.** 
和其他ip不冲突即可,网段可以通过查看vmnet1
编辑-虚拟机网络编辑器  也可以在win系统ipconfig  查看VMware Network Adapter VMnet1的ipv4网络协议
[root@tiejiang ~]# ifdown eth1
[root@tiejiang ~]# ifup eth1
[root@tiejiang ~]# ifconfig

我这里没有拷贝eth1的文件,直接用

[root@tiejiang ~]# dhclient

获得的eth1的ip,发现ping外网不通

找到DNS设置的配置文件 /etc/resolv.conf 文件

添加dns

给虚拟机添加eth1网络适配器(网卡)

还需要检查系统默认的网关,找到 /etc/sysconfig/network

给虚拟机添加eth1网络适配器(网卡)

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/55204.html

(0)
上一篇 2021年8月7日
下一篇 2021年8月7日

相关推荐

发表回复

登录后才能评论