CentOS 7 Network configuration

Source: Internet
Author: User

Go to catalogue /etc/sysconfig/network-scripts

VI ifcfg-eno16777736

DHCP Dynamic settings

  Just change the last line onboot=no to Omboot=yes, re-save, and restart the Web Services service network restart. You can test with the ping command. (The default installation does not support some commands such as ifconfig, subsequent installation of related modules) or using IP addr (can be abbreviated as IP a)

Static IP Settings

  As a server, it is set to static IP. To set the method, first add the following code:

Hwaddr=00:0c:29:e0:27:a5
Type=ethernet
Bootproto=static
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=no
Ipv6init=yes
Ipv6_autoconf=yes
Ipv6_defroute=yes
Ipv6_peerdns=yes
Ipv6_peerroutes=yes
Ipv6_failure_fatal=no
name=eno16777736
Uuid=a34bdb2f-9010-4fc1-84a2-b915eebf7b65
device=eno16777736
Onboot=yes
ipaddr=192.168.222.128
gateway=192.168.222.255
netmask=255.255.255.0
dns=192.168.222.255
Nm_controlled=no//Do not use network Manager

Restarting network (via systemctl):  Job fornetwork.service failed. See‘systemctl status network.service‘ and ‘journalctl -xn‘ fordetails

1、首先确定ifcfg-eno16777736文件中的HWADDR(MAC地址)与ip a命令后显示的MAC是否一致。

2、使用service network restart 或者systemctl restart network.service 命令,可能不会立即生效。使用ifdown eno16777736,然后ifup eno16777736 即可。

CentOS 7 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.