Network Connectivity

Denys Vlasenko vda.linux at googlemail.com
Thu Apr 16 19:48:50 UTC 2009


On Wednesday 15 April 2009 03:06, Chris Plasun wrote:
> >>I'm having issues with network connectivity. I've been reading all day 
> >>trying to get the board to connect to the LAN.
> >>
> >>LED's showing network connectivity are on but I can't ping anything on 
> >>the network.
> >>
> >So this tells us that you have link so the hardware 
> >thinks everything is happy.
> 
> Yes.
> 
> >>I wouldn't spend time on DHCP until you know that the packets are even 
> >>being sent out?  
> 
> That's exactly it. Ping didn't work.
> 
> I thought I could use DHCP as a shortcut. Also, The start and end IP addresses
> in /etc/udhcpd.conf were out of range of what we use.

Shock. How dare busybox project not to read your mind and not
pre-select IP range specifically for you.

Okay, I am switching humor mode off.

> I thought maybe that could be it and changed the settings but to no avail...  

udhcpd is not a DHCP client, it's a DHCP server. You need udhcpc:

# udhcpc --help
BusyBox v1.14.0.svn (2009-04-14 23:28:53 CEST) multi-call binary

Usage: udhcpc [-Cfbnqtvo] [-c CID] [-V VCLS] [-H HOSTNAME] [-i INTERFACE]
        [-p pidfile] [-r IP] [-s script] [-O dhcp-option]...

        -V,--vendorclass=CLASSID        Vendor class identifier
        -i,--interface=INTERFACE        Interface to use (default eth0)
        -H,-h,--hostname=HOSTNAME       Client hostname
        -c,--clientid=CLIENTID  Client identifier
        -C,--clientid-none      Suppress default client identifier
        -p,--pidfile=file       Create pidfile
        -r,--request=IP         IP address to request
        -s,--script=file        Run file at DHCP events (default /usr/share/udhcpc/default.script)
        -t,--retries=N          Send up to N request packets
        -T,--timeout=N          Try to get a lease for N seconds (default 3)
        -A,--tryagain=N         Wait N seconds (default 20) after failure
        -O,--request-option=OPT Request DHCP option OPT (cumulative)
        -o,--no-default-options Do not request any options (unless -O is also given)
        -f,--foreground Run in foreground
        -b,--background Background if lease is not immediately obtained
        -S,--syslog     Log to syslog too
        -n,--now        Exit with failure if lease is not immediately obtained
        -q,--quit       Quit after obtaining lease
        -R,--release    Release IP on quit
        -a,--arping     Use arping to validate offered address

Note: just running "udhcpc --interface=eth0" in many cases don't work.
It's crucial to have --script=... and have that script to correctly
interpret the data from udhcpc and set up address, routing, and DNS.

In distributions, this is usually "sugar coated" behind some GUI,
but since you seem to do it w/o distro help, it's YOUR responsibility
to ensure the script works correctly. busybox's source tree
has examples in examples/udhcp/*. I can't guarantee they are 100% correct,
but should be a good starting point.

Use --foreground option for test runs to not torture yourself
by fishing udhcpc messages from syslog and killing it with kill <PID>.
With --foreground, messages go to screen and ^C kills.

Don't forget "ip link set dev eth0 up" too in order to be able
to send anything at all...

> >>Have you tried assigning just a static ip address to 
> >>the interface??
> 
> That was going to be the next step.

I'd say that, as a test, had to be a 1st step, as it is less complex.
--
vda


More information about the busybox mailing list