Linux Articles March 14, 2014 1

Altering network configuration and hostname in Oracle Linux 6

A prerequisite for this exercise is running Oracle Linux 6. Installation and configuration has been described in this article:  Installing Oracle Linux 6 and preparing for Oracle Software installations.

  • Clone and power up virtual machine and connect to the server (for example: using putty)

Cloning virtual machine in Oracle VirtualBox involves the fallowing steps:

TIP: To power up virtual machine you may use VirtualBox GUI or the following command;

user@host:~$ VBoxManage startvm <VM_NAME> --type headless

neo@zion:~$ VBoxManage startvm DB_12c_ZEUS --type headless

Our new OS has seed’s IP (192.168.2.130) and hostname (demo) settings. Let’s alter it.

  • Login to linux server as root, pen terminal and and edit “/etc/sysconfig/network”
#Change HOSTNAME
NETWORKING=yes
HOSTNAME=zeus
GATEWAY=192.168.2.1
  •  Update /etc/hosts file:

Make sure that hosts file have right entries (remove or comment out lines with ipv6), make sure there is correct IP and hostname, edit /etc/hosts as root:

127.0.0.1       localhost.localdomain  localhost
192.168.2.120   zeus.zion.local    zeus
  • Alter IPADDR and remove HWaddr, edit /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=none
#HWADDR=00:33:E1:2A:FA:D8 # comment out or remove this line
IPADDR=192.168.2.120
PREFIX=24
GATEWAY=192.168.2.1
DNS1=8.8.8.8
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth0
ONBOOT=yes

Reboot the system.