How To Configure Static IP On CentOS 6

How To Configure Static IP On CentOS 6

 

Configure static IP on interface eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:41:36:94:45:DE" #Replace with your
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
IPADDR=192.168.0.100       #Replace with your IP
NETMASK=255.255.255.0      #Replace with your

 

Configure Default Gateway
# vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=myserver   #Replace with your hostname
GATEWAY=192.168.0.1 #Replace with your gateway IP

 

Configure DNS Server
# vi /etc/resolv.conf

nameserver 192.168.0.1 #Replace with your servers
nameserver 8.8.8.8

 

Restart Network Interfaces
# /etc/init.d/network restart

 

See also: How to configure DHCP on CentOS / RHEL

arstech

One Comment

Leave a Reply