Installing a CentOS system on a VMware Workstation virtual machine, when the system is unable to access the Internet, we can use the usual configuration method as follows:
Type=ethernet
Device=eth0 #网络虚拟接口名
hwaddr=00:0c:29:60:ff:8b #网卡mac地址
Onboot=yes #启动系统时就激活
Nm_controlled=yes #实时生效, there is no need to restart the NIC immediately after the change takes effect.
Bootproto=dhcp #使用自动分配IP地址
Note: Virtual Machine network connection mode select NAT
When we use the server to install the CentOS system, the production environment is configured as follows:
To configure a static IP address:
[Email protected] ~]# Cat/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0
Bootproto=static
ipaddr=117.40.239.12
netmask=255.255.240.0
gaeway=117.40.239.1
Hwaddr=00:21:97:68:f2:70
Type=ethernet
uuid=480c82ca-d673-466d-902a-9f31eaeb897c
Onboot=yes
Nm_controlled=no
To set up a gateway:
[Email protected] ~]# cat/etc/sysconfig/network
Networking=yes
hostname=sky9896
gateway=117.40.239.1
Set up DNS
[Email protected] ~]# cat/etc/resolv.conf
NameServer 202.101.224.68
NameServer 8.8.8.8
This article from the "Operation and Maintenance" blog, reproduced please contact the author!
centos6.5/6.6 system configuration on virtual machine dynamic mode of Internet access and production environment configuration public network mode