linux-Network Configuration

Source: Internet
Author: User
There are two types of network configuration:
One: Auto get
Dhclient to get IP address
Dhclinet-r can release IP address
Ifconfig to view the current IP address
If you encounter a ifconfig this command, yum installation is required
Yum Install-y Net-tools

Second, manual changes
vi/etc/sysconfig/network-scripts/ifcfg-ens160

Bootproto=static #改为静态ip
Onboot=yes #开机激活网卡
ipaddr=192.168.1.90 #设置IP地址
netmask=255.255.255.0 #设置子网掩码
gateway=192.168.1.1 #设置网关
dns1=202.99.96.168 #设置DNS1
dns2=202.99.104.68 #设置DNS2

After the configuration is complete, you need to restart the NIC
CentOS 6:service Network Restart
Centos7:systemctl Restart Network.service

Check:
Ping baidu.com whether the ping pass

linux-Network Configuration

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.