DHCP stands for Dynamic Host Configuration Protocol. That is an standardized networking protocol used on Internet Protocol (IP) networks for dynamically distributing network configuration parameters, such as IP address for interfaces and services. There are two general purposes for
- Automatically distributing IP address to users from local area network or ISP
- A centralized management for all computers within local area network
In order to control my humanoid robot remotely, DHCP sounds a great idea. I could set up the DHCP server on raspberry pi and plugin RJ45 on both computers. It allows to remote command-line login via SSH (Secure Shell) and transfer a file via SCP (Secure Copy). It is very helpful for program and debug.
So let's see how to make it out !!
A popular DHCP server for Raspberry Pi is ISC's dhcpd. You can install the package in a normal way using apt-get (Before it, make sure to update the local package cache using apt-get update)
The DHCP server requires a static IP address and by default, the Pi will have a DHCP one. Edit
/etc/network/interfaces
And modify the records that pertain to
eth0 using the network parameters for your network
Edit
/etc/dhcp/dhcpd.conf
The configuration file to suit your requirements. All of the main configuration items are commented out and this is why the startup failed previously.
Edit
/etc/default/isc-dhcp-server and uncomment the following records, inserts your network interface name as appreciate and changing the file path if you have chosen to put the file somewhere.
Finally, restart the DHCP daemon process using
service command (Make sure to plugin the RJ45 before restart DHCP daemon)
Reference :