vmware中安装centos的网络设置

 

在VMWARE中安装centos,并且centos可以访问外网,需要在以下几个文件中进行相关配置

 

[root@localhost ~]# more /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.0.1

[root@localhost network-scripts]# more ifcfg-eth0
DEVICE="eth0"
HWADDR="00:0C:29:3B:24:30"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPADDR=192.168.0.186
NETWORK=192.168.0.1
NETMASK=255.255.255.0
BOOTPROTO="static"
IPV6INIT=no
IPV6_AUTOCONF=no
TYPE=Ethernet

[root@localhost network-scripts]# more /etc/resolv.conf
nameserver 202.106.0.20
nameserver 8.8.8.8


[root@localhost network-scripts]# more /etc/sysconfig/network-scripts/route-eth0
via 192.168.0.1

你可能感兴趣的:(centos)