2014年9月22日 星期一

[Raspberry Pi] Install DHCP Server into Raspberry Pi

1: sudo apt-get install isc-dhcp-server

After installation will show fail startup.

2: sudo tail /var/log/syslog
Sep 22 14:51:38 raspberrypi dhcpd:
Sep 22 14:51:38 raspberrypi dhcpd: No subnet declaration for eth0 (192.168.50.100).
Sep 22 14:51:38 raspberrypi dhcpd: ** Ignoring requests on eth0. If this is not what
Sep 22 14:51:38 raspberrypi dhcpd: you want, please write a subnet declaration
Sep 22 14:51:38 raspberrypi dhcpd: in your dhcpd.conf file for the network segment
Sep 22 14:51:38 raspberrypi dhcpd: to which interface eth0 is attached. **
Sep 22 14:51:38 raspberrypi dhcpd:
Sep 22 14:51:38 raspberrypi dhcpd:
Sep 22 14:51:38 raspberrypi dhcpd: Not configured to listen on any interfaces!
Sep 22 14:51:39 raspberrypi kernel: [ 3093.064763] device eth0 entered promiscuous mode

3: Modify sudo vim /etc/network/interfaces
iface eth0 inet static
address 192.168.50.100
netmask 255.255.255.0
gateway 192.168.50.1

4: Restart eth0 again
sudo ifdown eth0
sudo ifup eth0

5: sudo vim /etc/dhcp/dhcpd.conf
Add following command
option domain-name-servers 8.8.8.8, 8.8.4.4;
# My First subnet declaration
subnet 192.168.50.0 netmask 255.255.255.0 {
range 192.168.50.101 192.168.50.254;
option routers 192.168.50.100;
}

6: sudo service isc-dhcp-server restart
Stopping ISC DHCP server: dhcpd failed!
Starting ISC DHCP server: dhcpd.

Reference :
1. Installing DHCP on your Raspberry Pi




Related Posts:

0 意見:

張貼留言