Centos 7 turn on network card to get IP automatically

Source: Internet
Author: User
Tags get ip

Centos7 default installation is not enabled to configure network card information, unable to access the extranet.

The bottom configuration opens the network to get the IP address automatically

1. View network card information

Executive Ifconfig

eno16777736:flags=4163<up,broadcast,running,multicast> MTU inet 6 fe80::20c:29ff:fee8:8637 prefixlen ScopeID 0x20<link> ether 00:0c:29:e8:86:37 txqueuelen (ether NET) Rx packets 1121 Bytes 98968 (96.6 KiB) Rx Errors 0 dropped 0 overruns 0 frame 0 TX packets 1 Bytes 25233 (24.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo:flags=73<up,loopback,ru        Nning> MTU 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6:: 1 prefixlen ScopeID 0x10
eno16777736 represents the name of the network card, and Ether 00:0c:29:e8:86:37 represents the MAC address of the NIC 
2. Configure the network adapter to start networking

cd/etc/system/network-scripts/
VI ifcfg-eno16777736
hwaddr=00:0c:29:e8:86:37TYPE=Ethernetbootproto=Dhcpdefroute=Yespeerdns= yespeerroutes=yesipv4_failure_fatal=noipv6init=yesipv6_autoconf=  Yesipv6_defroute=Yesipv6_peerdns=yesipv6_peerroutes=yesipv6_failure_fatal= NoNAME=eno16777736uuid=79d6c916-aab8-45e4-a163-37ae73393d26onboot=no

Change onboot= No to Onboot=yes

3. Restart the network

Service Network restart

4. Re-execution of Ifconfig

Eno16777736:flags=4163<up,broadcast,running,multicast> MTU 1500inet192.168.159.128 netmask 255.255.255.0 Broadcast 192.168.159.255Inet6 Fe80::20c:29ff:fee8:8637 Prefixlen ScopeID 0x20<link>ether00:0c:29:e8:86:37 Txqueuelen 1000(Ethernet) RX packets1699 bytes 140091 (136.8KiB) RX Errors0 dropped 0 overruns 0 frame 0TX Packets333 bytes 42669 (41.6KiB) TX Errors0 dropped 0 overruns 0 carrier 0 collisions 0Lo:flags=73<up,loopback,running> MTU 65536inet127.0.0.1 netmask 255.0.0.0Inet6::1 Prefixlen ScopeID 0x10Loop Txqueuelen0(Local Loopback) RX packetsBytes 78372 (76.5KiB) RX Errors0 dropped 0 overruns 0 frame 0TX PacketsBytes 78372 (76.5KiB) TX Errors0 dropped 0 overruns 0 carrier 0 collisions 0
inet 192.168.159.128 represents an IP address

Centos 7 turns on network card to get IP automatically

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.