当前位置: 移动技术网 > 网络运营>服务器>Linux > VMWare中CentOS ifcfg-eth0配置方法(亲测直接可用)

VMWare中CentOS ifcfg-eth0配置方法(亲测直接可用)

2019年06月02日  | 移动技术网网络运营  | 我要评论

这些配置是基于vmware network adapter vmnet8,假设我的vmware network adapter vmnet8 ip地址是192.168.106.1

具体如下图:

则我的ifcfg-eth0文件配置如下:

device=eth0 
type=ethernet 
uuid=f9f0898c-bf2c-4183-857a-eab291cd904d 
onboot=yes 
nm_controlled=yes 
bootproto=static 
ipaddr=192.168.106.130 
netmask=255.255.255.0 
broadcast=192.168.106.255 
gateway=192.168.106.2 
dns1=114.114.114.114 
dns2=8.8.8.8 
defroute=yes 
ipv4_failure_fatal=yes 
ipv6init=no 
name="system eth0" 
hwaddr=00:0c:29:22:d2:64 
peerdns=yes 
peerroutes=yes 
last_connect=1456741165 

我将我centos的ip设置为192.168.106.130 与vmware network adapter vmnet8在同一个网段。

注:ifcfg-eth0文件在centos中的路径为:/etc/sysconfig/network-scripts/ifcfg-eth0 

修改文件后要执行命令#service network restart 或者  #/etc/init.d/network restart  使修改生效

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持移动技术网。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网