| Busybox and DHCP |
| Written by Webmaster | |
| Saturday, 14 April 2007 | |
![]() Linux My solution to the problem is below the fold... My solution? First off, turn off DCHP in the kernel BUT allow the TCP and NFS so that it is possible to boot off an NFS server (trust me, this makes development a breeze). When the kernel comes up if you do an ifconfig the only thing that should be there is lo (the loopback device). Next, go download a copy of dhcpcd, it is a full-featured DHCP client that, from what I can tell, does pretty much everything that Busybox DOESN'T do (like hang). It builds, it works, it scores! Okay, but how do I get eth0 (or whatever your network device happens to be) to work? Okay, Static IP To set a static IP you would enter the following: ifconfig eth0 192.168.0.55 netmask 255.255.255.0 up This SHOULD bring up the network. Now the next thing you HAVE to do to get things working right is the following: echo "nameserver 11.11.11.11" >/etc/resolv.conf This sets up the DNS (Domain Name Server) so that when you ping www.google.com it can find the IP address that corresponds to. Dynamic IP This is the easy part. Type in the following: dhcpcd eth0 That's it! The dhcpcd daemon will start up and hook up to eth0. If you want to get fancy you can even add a timeout (for those times that you want to do this in the start up script but don't want it to "hang for 2 minutes"). What's Left To Do? Actually, quite a bit. You need a startup script in case you have a need to switch between static and dynamic. And then there are always those "nice things" like the ability to add multiple IP's to a NIC, and I could go on and an. But you get the idea. |
|
| Last Updated ( Saturday, 14 April 2007 ) |