LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DHCP IP not being brought up (https://www.linuxquestions.org/questions/linux-networking-3/dhcp-ip-not-being-brought-up-884627/)

vzxen 06-05-2011 05:15 AM

DHCP IP not being brought up
 
Hi,

I have made a CentOS AMI Image for Amazon EC2
Now the network is starting but it doesnt even try to determine the IP :
Bringing up interface eth0: [ OK ]

BUT if I hit the ifconfig :
eth0 Link encap:Ethernet HWaddr 12:31:39:0A:99:F8
inet6 addr: fe80::1031:39ff:fe0a:99f8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:90 (90.0 b)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:316 (316.0 b) TX bytes:316 (316.0 b)

What could be possibly wrong ?
The network script is not even trying to determine the IP.
Please help.

Snark1994 06-05-2011 07:45 AM

How are you connecting to the network (wired or wireless)? And how are you getting your IP (DHCP or static)?

My guess is probably wired+DHCP, and if so, you probably just need to run "dhcpcd eth0" (or another DHCP client) in order to get assigned an IP address. If not, then tell us a bit more about your setup and we might have more chance of working out what's going wrong :) the "Bringing up the interface eth0" message doesn't say anything about actually connecting to the internet.

Hope this helps,

vzxen 06-05-2011 01:14 PM

Hi,

Its a VM on Amazons EC2.
So yes its wired and DHCP.

Isnt "dhcpcd eth0" supposed to run on startup ??

sibe 06-06-2011 12:01 AM

--
Quote:

Originally Posted by vzxen (Post 4376781)
What could be possibly wrong ?
The network script is not even trying to determine the IP.

Nothing wrong with it; an UP and RUNNING interface without an IP is normal.
You should check the configuration to see if the interface is set with BOOTPROTO=dhcp. Otherwise, you can set it manually.

To make sure if there's a DHCP server running on the network segment, invoke the client to get an address :
Code:

# dhclient eth0

vzxen 06-06-2011 09:14 AM

Hi,

Is "dhclient eth0" to be called after NETWORK startup or before ?

sibe 06-06-2011 03:20 PM

Hi,

you can call dhclient at any time, if it succeeded, then your interface should be set with a valid address, a default gateway and DNS IP. You should see something like this :

Code:

~# dhclient eth0
--output cut--

DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 10.1.1.254
bound to 10.1.1.129 -- renewal in 769 seconds.
~#

From this point you should check the configuration file, /etc/sysconfig/network-scripts/ifcfg-eth0, and set it with BOOTPROTO=dhcp, and you're good to go.


All times are GMT -5. The time now is 01:04 AM.