DHCP is an acronym for Dynamic Host Configuration Protocol. A DHCP server automatically assigns IP addresses to devices that attempt to connect to a network. Commands used to install a DHCP server:
sudo apt-get install isc-dhcp-server # installs the DHCP server
sudo nano /etc/dhcp/dhcpd.conf # Edit this file
# Comment out these two sections on lines 13-14:
# option domain-name "example.org";
# option domain-name-servers ns1.example.org, ns2.example.org;
# Remove the comment from line 21:
authoritative;
# Add this segment at the end of the file:
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.80 192.168.1.90;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "Pi-AP";
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
# Save the file
sudo nano /etc/default/isc-dhcp-server # Edit this file
INTERFACES="wlan0"
# Save the file
sudo nano /etc/network/interfaces # Edit this file
iface wlan0 inet static # Changed from iface wlan0 inet dhcp
address 192.168.1.1
netmask 255.255.255.0
# iface default inet dhcp # Comment out this line
No comments:
Post a Comment