In this tutorial I am going to demonstrate step by step installation of CentOS 7, IP address assignment, setting default gateway, setting DNS and installation of webmin (a very handy and browser based Linux administration tool/utility). So let’s start.

Please check here the CentOS 7 latest ISO. Following is step no. 1 boot your server with CentOS 7 ISO/DVD.

You can also test the media and then select the highlighted and hit Enter
Just wait and actual setup will start
Select Language and click on “Continue”
By default minimal installation has been selected, but we need this server to be use as Webserver so we have to change this selection
Select basic web Server and please do not select any ADD-Ons, as shown in above snapshot
As shown in above snapshot, must have to select the partition where this CentOS will be installed, just click on it
Click on Disk icon and then click on “Done
As highlighted in above snapshot, prerequisites been fulfilled, so will click on Begin Installation
At this stage installation has been started, but we must set password for root or we can also create any other user. for this tutorial I will only set password for root
Once password has been set click on “Done” to continues
password has been set for root and it will take sometime to complete this installation setup
Installation has been done and it is asking to reboot, please click on “Reboot”
Congratulation! you have installed CentOS 7 in very easy steps. Now login using user root and the password you provided during installation

As we have just installed CentOS 7 on our server and next step will be to set IP address, default gateway and DNS so this server will come online on Internet

[root@localhost ~]# ifconfig
As we have execute this command but as shown above no IP address has been set

Now I will set IP address using following command
[root@localhost ~]# ifconfig eth0 netmask up
Please note: is in my example, please set the IP as per your network.

IP has been set

Next, default gateway has to be set, following is command
[root@localhost ~]# route add default gw
Note: Please set your network’s default gateway

Default route added, and route -n is command to check routing table. It is showing default gateway has been set

Now we will test by pining external IP address that our default gateway has been set.
[root@localhost ~]# ping

ping is successful, now we will try to ping domain for example
Ping to domain ( has been failed as this is showing: Name or service not known
This means we have to set DNS

In CentOS DNS server addresses have to be added into resolv.conf and following this the path. I am using vi editor you can use any other editor like nano
[root@localhost ~]# vi /etc/resolv.conf

Hit enter

As I am using “vi” editor so above command will open this above file, to enable edit or to write anything either press “insert” key on your keyboard or press “i” key. Put following into the file
and to save this please press “esc” key then type :wq and hit enter this will save DNS setting on server

Once DNS has been set, we can again test it by pinging and this time it should be successful

As our server has now internet connectivity and we can now use a ssh utility known as putty (you can download it from here)

Leave every setting as is and put your server’s IP address and click open
1st time it will be showing this Warning but just click on yes to get login prompt of your server

Up to this point CentOS 7 has been installed and internet accessibility been provided. The way I have provided IP address and default gateway is called active configuration and if server reboot or shutdown the configuration will be removed. That mean you have to again assign settings.
There are number of methods to save IP address and default gateway so whenever server will reboot it will retain it’s IP address and gateway configuration.

The method I am going to demonstrate you is using a browser base tool known as webmin.
First, we need to add the Webmin repository so that we can easily install and update Webmin using our package manager. We do this by adding a new file called /etc/yum.repos.d/webmin.repo that contains information about the new repository.
[root@localhost ~]# vi /etc/yum.repos.d/webmin.repo

Then add these lines to the file to define the new repository:

name=Webmin Distribution Neutral
save and exit (esc then :wq enter)

Next, add the Webmin author’s PGP key so that your system will trust the new repository:

[root@localhost ~]# wget
[root@localhost ~]# rpm --import jcameron-key.asc

You can now install Webmin:
[root@localhost ~]# yum install webmin

Whenever it will ask press y to continue and this will install Webmin

By default in CentOS 7 firewall has been enabled but for this tutorial we will disable firewall using this command.

[root@localhost ~]# service firewalld stop

now open any browser and put your server IP address with https like this:

login using username : root

Go to Networking and it will show Network Interface, Routing and gateway, we will set here IP address and default gateway which will be set at boot, so after reboot our server’s IP address and default gateway will be there

go to the tab “Activated at boot”
our interface is eth0 click on it
Set IP address and default gateway and leave rest of the settings as is and click on save and apply
on “Boot time configuration” tab select interface in our example it is eth0 and gateway set as click on “save”

Once boot time IP address and default gateway have been set we can test these configuration by restarting our server. following is the command to restart.

[root@localhost ~]# init 6

Once server reboot login and check IP address, ping to an external IP address and ping a domain

This all about simple step by step CentOS 7 installation with webmin

Categories: Tutorial


Leave a Reply

Your email address will not be published. Required fields are marked *