NOTE:I know this is way past the timeline of this thread but I haven't seen any development on it years, so I had to post. Plus being a first time poster I made mistakes in the process somewhere. Tell what to fix in my post structure and I'll do it.
I just ran into this "DHCP4 client NOT running" issue and couldn't find a solution on it in the forums. Fortunately a coworker and I were able to figure out what was going on behind the scenes and fixed it(for us)!!!
Error:
Code:
Shutting down network interfaces:
eth0 device: Intel Corporation I350 Gigabit Network Connec done
Hint: you may set mandatory devices in /etc/sysconfig/network/config
Setting up network interfaces:
eth0 device: Intel Corporation I350 Gigabit Network Connec
eth0 Starting DHCP4 client. .
eth0 DHCP4 client NOT running failed
- What is the Problem?
- The script handling starting the DHCP process for your interfaces is being called with incorrect parameters.
- Further Explanation:
- When all the various network scripts are called, /sbin/dhcpcd is called to turn on dhcp service for the specified ethernet port.
- dhcpcd expects very specific parameters and has very little in the way of debugging the problems themselves.
- How to Fix it?
- There was an issue with my hostname, I presume the same can be said for your machine.
- myhostname was: root@server
- See that "@" symbol? Well the DHCP server isn't going to handle that quite right and so dhcpcd says "err, suspect string in hostname argument". That was the puzzle piece that put it all together for me.
- So just change your hostname and all will be well.
Process to figure it out:
Did an strace:
Code:
root@server:/etc/sysconfig/network # strace -s 1024 -o foo -f /sbin/ifup-dhcp eth0 eth0
from within the strace i found this line:
Quote:
31194 execve("/sbin/dhcpcd", ["/sbin/dhcpcd", "--netconfig", "-L", "-E", "-G", "-c", "/etc/sysconfig/network/scripts/dhcpcd-hook", "-t", "120", "-h", "root@server", "eth0"], [/* 70 vars */] <unfinished ...>
|
so I tried to run the dhcpcd call manually:
Code:
root@server:/etc/sysconfig/network # /sbin/dhcpcd "--netconfig" "-L" "-E" "-G" "-c" "/etc/sysconfig/network/scripts/dhcpcd-hook" "-t" "120" "-h" 'root@server' "eth0"
Quote:
err, suspect string in hostname argument
|
So, I looked at the hostname argument and stripped it down to just "server" (Leaving out the "@" was important here).
Code:
root@server:/etc/sysconfig/network # /sbin/dhcpcd "--netconfig" "-L" "-E" "-G" "-c" "/etc/sysconfig/network/scripts/dhcpcd-hook" "-t" "120" "-h" 'server' "eth0"
and got this back:
Quote:
eth0 device: Intel Corporation I350 Gigabit Network Connection (rev 01)
err, eth0: Failed to lookup hostname via DNS: Name or service not known
eth0 device: Intel Corporation I350 Gigabit Network Connection (rev 01)
|
and when I checked ifconfig eth0:
Code:
root@server:/etc/sysconfig/network # ifconfig eth0
Quote:
eth0 Link encap:Ethernet HWaddr B8:CA:3A:68:34:70
inet addr:39.80.8.12 Bcast:39.95.255.255 Mask:255.240.0.0
inet6 addr: fe80::baca:3aff:fe68:3470/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:24538 errors:0 dropped:0 overruns:0 frame:0
TX packets:3537 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2978118 (2.8 Mb) TX bytes:951302 (929.0 Kb)
|
So it's grabbing the hostname for the DNS server to use
so, to make sure it doesn't fail to pass a valid hostname when "ifup" is called I changed the hostname:
Code:
server:/etc/sysconfig/network # echo "server" > /etc/HOSTNAME
root@server:/etc/sysconfig/network # hostname server
root@server:/etc/sysconfig/network # ifdown eth0
root@server:/etc/sysconfig/network # ifup eth0
Quote:
eth0 device: Intel Corporation I350 Gigabit Network Connection (rev 01)
Starting DHCP4 client on eth0. . . . . .
eth0 IP address: 39.80.8.12/12
|
Hooray!!!!