Bug 1963 - udhcpc failed bind IP address to iface (eth0) in rcS but manually execute can
Summary: udhcpc failed bind IP address to iface (eth0) in rcS but manually execute can
Status: RESOLVED WORKSFORME
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.16.x
Hardware: PC Windows
: P5 blocker
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-07 06:28 UTC by nick
Modified: 2010-09-02 10:55 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nick 2010-06-07 06:28:40 UTC
Environment: 
   PXE server:with tftpd-hpa + dhcp3-server
   PXE client: kernel 2.6.32.11 built from ubuntu 10 lts + self made initrd using busybox 1.61

Symptom:
1.Edit /etc/init.d/rcS to include the below
  ifup -a
  udhcpc -s /usr/share/udhcpc/default.script (copied from busybox source's example/dhcpc/simple.script)
2.boot a client using pxe server
3.success boot client
4.type ifconfig, showed no inet address is allocated, except inet6 address

Please help! I cannot move forward for deployment for work.

More foundings:
1.if you type udhcpc can # prompt, still not able to get IP address it only shows
#udhcpc
udhcpc (v1.16.1) started
Sending discover...
Sending select for 192.168.40.136
Lease of 192.168.40.136 obtained, lease time 1800
#
2. If you type udhcpc -s /usr/share/udhcpc/default.script, eth0 will succeed at get and bind IP v4 adress.

3. If you type udhcpc, IPv4 cannot bind to eth0. 

Very confused - What is the difference between run "udhcpc -s /usr/share/udhcpc/default.script" in rcS and run in interactive shell by hand??



Help!
Help!

Thank,
Nick
Comment 1 Denys Vlasenko 2010-06-08 03:34:52 UTC
1.Edit /etc/init.d/rcS to include the below
  ifup -a
  udhcpc -s /usr/share/udhcpc/default.script (copied from busybox source's
example/dhcpc/simple.script)

ifup -a will run various things depending on its configuration.
Are you sure it doesn't mess up eth0 configuration? Try removing this command.

Can you run udhcpc with -f option so that it prints some information to the screen?
Comment 2 Denys Vlasenko 2010-08-05 13:17:04 UTC
Any news?
Comment 3 Denys Vlasenko 2010-08-11 21:54:57 UTC
Closing as "works for me", assuming reporter had ifup/udhcpc conflict
Comment 4 nick 2010-08-13 13:09:08 UTC
I verified on machine it doesn't work, if commented out "ifup -a"

it will throw the below information while booting
===Info start===
Create kernkel devices...
udhcpc(v1.16.1) started
Sending discover...
udhcpc: sendto: Network is donw
Read error: Network is down, reopening socket
Sending discover...
...(omitted)...
No lease, failing
#
====Info end===

I'm not sure what configuration need to change to make it work? could paste you eth0 configuration here, especially the content under /etc/network ? (that may be root cause)

Thanks, 
Nick
Comment 5 Denys Vlasenko 2010-08-14 02:59:13 UTC
(In reply to comment #4)
> I verified on machine it doesn't work, if commented out "ifup -a"
> 
> it will throw the below information while booting
> ===Info start===
> Create kernkel devices...
> udhcpc(v1.16.1) started
> Sending discover...
> udhcpc: sendto: Network is donw
> Read error: Network is down, reopening socket
> Sending discover...
> ...(omitted)...
> No lease, failing
> #
> ====Info end===
> 
> I'm not sure what configuration need to change to make it work?

You need to "up"the device. Try "ip l set dev eth0 up"
Comment 6 Denys Vlasenko 2010-08-22 08:18:57 UTC
Any news?
Comment 7 Denys Vlasenko 2010-09-02 10:55:16 UTC
Closing as "works for me", assuming upping the interface helped.