In this tutorial I am going to show you, how to configure Static network in CentOS 7 and RHEL 7 after minimal installation? So let’s start and see step by step static network configuration.
After minimal installation of RHEL7 or CentOS7, May be we are not able to connect our server with network, It’s because Ethernet interfaces are not enabled by default.
Now we will see how to configure static Network in our server.
Setup Static network on CentOS7 minimal
First, of all we have to check our network interface card with this command “nmcli d” and you will see you network card status after run this command in you CLI console. Like below.
“nmcli d” command output, we can see here enp0s3 Ethernet interface card is discommoded. And we need to configure Network on this interface.
Then we type “nmtui” command in our terminal to open Network manager. Once our Network manager will be open then we have to select “Edit connection” and press Enter (Use TAB button for choosing options). Like below:-
You can see here CentOS7 Network manager screen
Now we can choose network interfaces where we want to configure network and click “Edit” like below screen shot:-
We can edit our network interfaces
Static Network Configuration
Here we are going to configure Static Network so we have to select “Manual” in IPv4 configuration and we have to assign our static IP and subnet. We need also assign Gateway for our static network. After that we have to select Automatically connect check box and press OK and quit from Network manager. Like below screen shot.
Static IP has been configured on enp0s3 network interface, now we need to restart network service so that we can access this server through IP. So let’s restart network service and check our network is properly working our not?
We can restart network service using below commands:-
[root@dns ~]# service network restart
After that our server has a Static IP we can check with “ip a” commands like below screen shot:-
CentOS 7 check IP address
We can check network accessibility with ping commands. We can also check ssh with putty. Here I am going to checking gateway accessibility or not with ping command, if our gateway is accessible then our server will be accessible from outside. So let’s check gateway accessibility:-
[root@dns ~]# ping 192.168.43.1 PING 192.168.43.1 (192.168.43.1) 56(84) bytes of data. 64 bytes from 192.168.43.1: icmp_seq=1 ttl=64 time=2.89 ms 64 bytes from 192.168.43.1: icmp_seq=2 ttl=64 time=2.76 ms 64 bytes from 192.168.43.1: icmp_seq=3 ttl=64 time=2.71 ms 64 bytes from 192.168.43.1: icmp_seq=4 ttl=64 time=2.92 ms 64 bytes from 192.168.43.1: icmp_seq=5 ttl=64 time=2.74 ms 64 bytes from 192.168.43.1: icmp_seq=6 ttl=64 time=2.92 ms ^C --- 192.168.43.1 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5008ms rtt min/avg/max/mdev = 2.718/2.828/2.927/0.108 ms [root@dns ~]#
You can see our Gateway is successfully ping so now we can access our server through outside with putty.
That’s all now we have completed Static IP setup on Minimal installation CentOS7 and RHEL7.
You can click on below link to setup DHCP Network in Linux.