Linux network configuration, linux Network

Source: Internet
Author: User

Linux network configuration, linux Network

After the centos system is installed in VMware, it cannot connect to the Internet. I checked a lot of information on the Internet and did not find a solution. Finally, write your own solution below.

Step 1: open a file

$ Vim/etc/sysconfig/network-scripts/ifcfg-eth0
# Automatic Retrieval
DEVICE = eth0
BOOTPROTO = dhcp # Automatic Retrieval
HWADDR = 00:
ONBOOT = yes
DHCP_HOSTNAME = WEBSERVER

Or

# Manually specify
DEVICE = eth0
BOOTPROTO = static
HWADDR = 00:
IPADDR = 192.168.137.30
MASK = 255.255.255.0
GATEWAY = 192.168.137.2
ONBOOT = yes

Step 2: configure the DNS address


$ Vim/etc/resolv. conf


Nameserver 219.141.136.10 # China Telecom
Nameserver 202.106.0.20 # China Unicom

Step 3: restart the network service

Service network restart

Ping www.baidu.com

 

OK

 

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.