1. Backup –

  • cp  /etc/sysconfig/network-scripts/ifcfg-eth0  /etc/sysconfig/network-scripts/ifcfg-eth0.bak
  • cp /etc/resolv.conf /etc/resolv.conf.backup

2. Change –

  • vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=”eth0″
BOOTPROTO=”static”
HWADDR=”xx:xx:xx:xx:xx:xx”
NM_CONTROLLED=”yes”
ONBOOT=”yes”
TYPE=”Ethernet”
IPADDR=192.168.1.2
NETMASK=255.255.255.0

IPv4

  • IP address: 192.168.0.100
  • Subnet: 255.255.255.0
  • Gateway: 192.168.0.1

IPv-6

  • IP address: 2001:db8::c0ca:1eaf
  • Netmask 64
  • Gateway 2001:db8::1ead:ed:beef

3. DNS

  • /etc/resolv.conf

search example.com
nameserver 8.8.8.8
nameserver 8.8.4.4

  • /etc/hosts

127.0.0.1 localhost
127.0.1.1 server1

  • service network restart
  • /etc/init.d/network restart
Advertisements