use DHCP in Linux system
DHCP is the Dynamic Host Configuration Protocol,which allows a networked machine to obtain its IP address and other informationautomatically from a DHCP server.
There are two methods through which a Linux systemcan obtain an IP address using DHCP:
1. Kernel level configuration.
2. User level configuration.
Kernel level auto-configuration:
To use kernel level auto configurtion select belowoptions in the Linux kernel configuration.
-> Networking support (NET [=y])
-> Networking options
-> TCP/IP networking (INET [=y])
[*] IP: kernel level autoconfiguration
[*] IP: DHCP support
Advantage:
In case of your root file system in NFS and wanted to have a IP dynamicaly configirued though DHCP, kernel level DHCP will come to rescue you. Using kernel level DHCP you will have have a valid IP address by the time the Linuxkernel have completed the booting and can immediately mount an NFS root filesystem.
Disadvantage:
1. Can only configure basic network parameters, which do not include items suchas DNS servers.
User level auto-configuration
I will use DHCP client applet that comes Busyboxnamed udhcpc
As per Busybox: