• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to configure network on CentOS 7

{{postValue.id}}

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
{{postCtrl.cmtErrMsg}}

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

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 Ganesh Konka ?
Zentya 6.1 http proxy configuration

please send link for creating zentyal 6.1 for http proxy and firewall as gateway.

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.