歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> CentOS之VMWare中CentOS ifcfg-eth0配置

CentOS之VMWare中CentOS ifcfg-eth0配置

日期:2017/3/6 9:50:15   编辑:學習Linux

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在CODE上查看代碼片派生到我的代碼片
  1. DEVICE=eth0
  2. TYPE=Ethernet
  3. UUID=f9f0898c-bf2c-4183-857a-eab291cd904d
  4. ONBOOT=yes
  5. NM_CONTROLLED=yes
  6. BOOTPROTO=static
  7. IPADDR=192.168.106.130
  8. NETMASK=255.255.255.0
  9. BROADCAST=192.168.106.255
  10. GATEWAY=192.168.106.2
  11. DNS1=114.114.114.114
  12. DNS2=8.8.8.8
  13. DEFROUTE=yes
  14. IPV4_FAILURE_FATAL=yes
  15. IPV6INIT=no
  16. NAME="Systemeth0"
  17. HWADDR=00:0C:29:22:D2:64
  18. PEERDNS=yes
  19. PEERROUTES=yes
  20. 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

Copyright © Linux教程網 All Rights Reserved