CentOS之VMWare中CentOS ifcfg-eth0配置
CentOS之VMWare中CentOS ifcfg-eth0配置
這些配置是基於VMware Network Adapter VMnet8,假設我的VMware Network Adapter VMnet8 ip地址是192.168.106.1
具體如下圖:
則我的ifcfg-eth0文件配置如下:
[plain]view plaincopy
- 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="Systemeth0"
- 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 使修改生效
http://xxxxxx/Linuxjc/1134104.html TechArticle