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.
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
Now I will set IP address using following command
[root@localhost ~]# ifconfig eth0 10.64.1.12 netmask 255.255.255.0 up
Please note: 10.64.1.12 is in my example, please set the IP as per your network.
Next, default gateway has to be set, following is command
[root@localhost ~]# route add default gw 10.64.1.1
Note: Please set your network’s default gateway
Now we will test by pining external IP address that our default gateway has been set.
[root@localhost ~]# ping 22.214.171.124
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
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 yahoo.com 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)
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:
[Webmin] name=Webmin Distribution Neutral #baseurl=http://download.webmin.com/download/yum mirrorlist=http://download.webmin.com/download/yum/mirrorlist enabled=1
Next, add the Webmin author’s PGP key so that your system will trust the new repository:
[root@localhost ~]# wget http://www.webmin.com/jcameron-key.asc [root@localhost ~]# rpm --import jcameron-key.asc
You can now install Webmin:
[root@localhost ~]# yum 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: https://10.64.1.12:10000/
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
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