• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to configure network on CentOS 7

67

To configure network on CentOS 7

Generally after installing CentOS 7 , the network cannot be connected in that machine. These troubleshooting methods helps to setup network on centos 7 in both GUI and Command mode.

To Setup network

To identify ethernet cards in your machine,you can use any of the three commands below
nmcli d (or) ifconfig (or) ip a,Here we are using “ nmcli d”
Type " nmcli d" in your terminal

Output

[root@linuxhelp ~]$ nmcli  d
DEVICE          TYPE          STATE             CONNECTION 
eno16777736     ethernet      disconnected          --         
lo               loopback unmanaged             --         

To setup network in GUI mode

Type “ nmtui” to open Network manager and then edit a connection

1

Available network interface will be displayed

2

To configure DHCP

1. Move the highlighter to the IPv4 CONFIGURATION and press enter
2. Choose “ Automatic” from the list
3. Choose Automatic Connect check box.
4. Press OK and quit Network manager.

3

4

To Restart network service

[root@linuxhelp ~]# systemctl restart network


The server gets the IP address from DHCP server

Static configuration For Manual IP address

1. Choose “ Manual” in IPv4 CONFIGURATION.
2. Add IP Address with Subnet , Gateway and DNS server ( Refer below image ).
3. Choose Automatic Connect check box.
4. Press OK and quit Network manager.

1

To restart network service

[root@linuxhelp ~]# systemctl restart network

In Command mode

In command line interface mode network can be set by editing the configuration file in the following path.

[root@linuxhelp ~]$ vim /etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=1edfad82-a530-4b13-8839-e985423c22b7
ONBOOT=no
HWADDR=00:0C:29:3D:1D:D9
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes

For DHCP configuration

Edit only the below mentioned two configuration
BOOTPROTO,ONBOOT
and replace it with
BOOTPROTO=dhcp
ONBOOT=yes

Now restart the network service through command line

[root@linuxhelp ~]# systemctl restart network

For Static Configuration
Edit the below configuration and also add some more configurations

BOOTPROTO=none
ONBOOT=no 
replace with
BOOTPROTO=static
ONBOOT=yes 

Now restart the network service through command line

[root@linuxhelp ~]# systemctl restart network


Now you can check ip using ip a command

[root@linuxhelp Desktop]# ip a
1: lo: < LOOPBACK,UP,LOWER_UP>  mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno16777736: < BROADCAST,MULTICAST,UP,LOWER_UP>  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:3d:1d:d9 brd ff:ff:ff:ff:ff:ff
    inet 192.168.5.67/24 brd 192.168.5.255 scope global eno16777736
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe3d:1dd9/64 scope link 
       valid_lft forever preferred_lft forever

If you just want to edit the hostname, edit the hostname file in the following path

[root@linuxhelp Desktop]# vim /etc/hostname

Tags:
christian
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

where do we set nameserver

A

/etc/resolve.conf

Q

anyother command to set network otherthan nmcli

A

nmtui

Q

I have set ipaddr manually in ifcfg file and restart network service . But I didn't get ipaddr . Because I didn't get any internet. Pls, help me with this issue

A

use ifup interface_name (or) nmcli conneection up interface_name

Q

I use nmcli , but shows command not found

A

check NetworkManager for properly . Start the NetworkManager and then try

Q

every time I restart , network goes down , is there any option network automatically starts when we start a machine. I already enable network service

A

IN /etc/sysconfig/network-scripts/ifcfg-interface_name change to onboot=yes

Related Tutorials in How to configure network on CentOS 7

Related Tutorials in How to configure network on CentOS 7

How To Install AnyDesk on Centos 7
How To Install AnyDesk on Centos 7
Apr 2, 2018
How to install Tiki Wiki CMS Groupware on CentOS 7
How to install Tiki Wiki CMS Groupware on CentOS 7
May 31, 2018
How to install PHP ImageMagick on CentOS 7
How to install PHP ImageMagick on CentOS 7
Nov 4, 2017
How to Upgrade and Downgrade the PHP Versions on CentOS 7.6
How to Upgrade and Downgrade the PHP Versions on CentOS 7.6
Jun 4, 2019
How to install Apache from Source Code on CentOS 7
How to install Apache from Source Code on CentOS 7
Oct 21, 2017
How to enable or disable repositories in CentOS
How to enable or disable repositories in CentOS
Mar 28, 2018
How to install AWStats on CentOS 7
How to install AWStats on CentOS 7
Dec 8, 2017
How to install Apache JMeter in CentOS 7
How to install Apache JMeter in CentOS 7
Mar 24, 2017

Related Forums in How to configure network on CentOS 7

Related Forums in How to configure network on CentOS 7

CentOS
connor class=
How To Completely Remove Apache package On CentOS 7.6
May 14, 2019
CentOS
ceriaimmaculate class=
setfacl : command not found
Jan 3, 2018
CentOS
mason class=
Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)
Nov 20, 2018
CentOS
landon class=
Command to find SNMP Version
May 28, 2018
CentOS
arjitharon class=
cannot start minio service help
Mar 10, 2018
Apache tomcat
AadrikaAnshu class=
Cannot find ./catalina.sh The file is absent or does not have execute permission This file is needed to run this program
Jun 17, 2019
gitlab
caden class=
Insufficient space in download directory /var/cache/yum/x86_64/6/base/packages
Jul 22, 2019
OpenVAS
frank class=
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Dec 20, 2018
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Ryan ?
how to use visual traceroute tool

Am using traceroute command to check for the route. i got this tool while surfing. So pls help me out installation and usage of Visual traceroute tool.

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.