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:
Save it and exit. Then restart network interface
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 deviceYou can also use:
ip addr showIf you would like to use ifconfig command but not installed, install it using:
yum -y install net-toolsThen check your ip address information using ifconfig command.
ifconfig -aThe interface i am going to create configuration for is eth1. Lets do it
cd /etc/sysconfig/network-scripts/Then add the following network parameters,replacing eth1 with your interface name.
vi ifcfg-eth1
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 eth1You can use ifup and ifdown as well to bring interfaces down and up.
nmcli connection up eth1
ifdown eth1I have a good tutorial on
ifup eth1
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.