Set network, IP address, and CentOS network IP address

Source: Internet
Author: User

Set network, IP address, and CentOS network IP address

1. log on to CentOS.

2. # dhclient automatically obtains the IP address

3. # ip addr

1). the first address 127.0.0.1 is the loopback address, and the NIC name is lo. This address is also available in Windows and can be used to communicate with you.

2). The second IP address 192.168.123.130 is the IP address automatically obtained. Ens33 is the name of the NIC.

4. After obtaining the IP address, check whether the IP address can be connected to the Internet.

# Ping-c 4 www.baidu.com

5. vi/etc/sysconfig/network-scripts/ifcfg-ens33

ONBOOT = no changed to yes indicates that the online publication starts with the system.

BOOTPROTO = changing dhcp to static. dhcp indicates dynamic retrieval, and static indicates manual setting of static IP addresses.

And add

IPADDR = 192.168.123.130 specified IP Address

NETMASK = 255.255.255.0 Subnet Mask

GATEWAY = 192.168.123.2 GATEWAY

DNS1 = 119.29.29.29

6. Restart the network service.

# Systemctl restart network. service

7. View IP addresses

# Ip addr

8. Network Connectivity

# Ping-c 4 www.baidu.com

 

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.