Quantcast
Channel: Computing For Geeks
Viewing all articles
Browse latest Browse all 78

Simple way to configure static ip address on CentOS 6.x and CentOS 7 Server

$
0
0
CentOS server is one of the most used Linux Servers in both Enterprise and SOHO. It is very stable,secure and easy to setup and get it running.
Today i will show simple static ip configuration, You just specify ip address, Network Mask, DNS server and default gateway.
First check  your network card name:
nmcli device
You can also use:
ip addr show
If you would like to use ifconfig command but not installed, install it using:
yum -y install net-tools
Then check your ip address information using ifconfig command.
ifconfig -a
The interface i am going to create configuration for is eth1. Lets do it
cd /etc/sysconfig/network-scripts/
vi  ifcfg-eth1
Then add the following network parameters,replacing eth1 with your interface name.
DEVICE=eth1
IPADDR=192.168.1.20
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=192.168.1.1
DNS2=8.8.4.4
ONBOOT=yes
BOOTPROTO=none
USERCTL=no

Save it and exit. Then restart network interface
nmcli connection down eth1
nmcli connection up eth1
You can use ifup and ifdown as well to bring interfaces down and up.
ifdown eth1
ifup eth1
I have a good tutorial on 

Top Things to do after fresh installation of CentOS 7 minimal

You can check it out and learn more on getting started with new installation of CentOS7 server.




Viewing all articles
Browse latest Browse all 78

Trending Articles