I have installed Oracle Linux 6.5 (minimal installation) on a virtual machine created on VMware vSphere 5.5. I have tried to configure dhcp during the installation by editing IPv4 Settings of System eth0 to use Automatic (DHCP) but somehow it does not work.
Then I changed the ifcfg-eth0 to use static ip address and that works.
Here is the content of /etc/sysconfig/network:
NETWORKING=yes
HOSTNAME=TESTOL
Here is the content of /etc/sysconfig/network-scripts/ifcfg-eth0 using static ip address:
DEVICE=eth0
TYPE=Ethernet
UUID=xxxxxxxx.xxxx-xxxx-xxxxxxxxxxxx
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=xx:xx:xx:xx:xx:xx
IPADDR:##.##.###.###
PREFIX=24
GATEWAY=##.##.###.###
DNS1=##.##.###.###
DOMAIN:test.com
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
Based on my understanding, I should able to use dhcp by changing ifcfg-eth0 (I commented the parameters not needed for dhcp by adding #) but I have tried the following ifcfg-eth0 and it does not work:
DEVICE=eth0
TYPE=Ethernet
UUID=xxxxxxxx.xxxx-xxxx-xxxxxxxxxxxx
ONBOOT=yes
NM_CONTROLLED=yes
#BOOTPROTO=no
BOOTPROTO=dhcp
HWADDR=xx:xx:xx:xx:xx:xx
#IPADDR:##.##.###.###
#PREFIX=24
#GATEWAY=##.##.###.###
DNS1=##.##.###.###
#DOMAIN:test.com
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
I have also tried to add GATEWAY=##.##.###.### to /etc/sysconfig/network but that does not help.
I have checked that dhclient package is installed by using rpm -qa dhclient.
I'm new to Linux.
Thanks for any help