centos6.5/6.6 system configuration on virtual machine dynamic mode of Internet access and production environment configuration public network mode

Source: Internet
Author: User
Tags nameserver

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.