wtorek, 17 grudnia 2019

Debian - DHCP - instalacja i konfiguracja


DHCP
Instalacja
root# apt-get install isc-dhcp-server
--------------------------------------------
START
sudo service isc-dhcp-server stop
 sudo service isc-dhcp-server start
 sudo ifconfig eth0 down
 sudo ifconfig eth0 up
--------------------------------------------
Contents of "/etc/network/interfaces":
# The loopback network interface (always required)
 auto lo
 iface lo inet loopback
 # Assign a static IP for this DHCP server through eth0:
 auto eth0
 iface eth0 inet static
                address 192.168.1.100
                netmask 255.255.255.0
                broadcast 192.168.1.255
                gateway 192.168.1.1
--------------------------------------------
Contents of "/etc/resolv.conf":
nameserver 8.8.8.8
 nameserver 8.8.4.4
--------------------------------------------
Contents of "/etc/dhcp/dhcpd.conf:
option domain-name "mydebian";
# Use Google public DNS server (or use faster values that your internet provider gave you!):
option domain-name-servers 8.8.8.8, 8.8.4.4;
# Set up our desired subnet:
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.101 192.168.1.254;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.1.255;
    option routers 192.168.1.100;
    option domain-name-servers home;
}
default-lease-time 600;
max-lease-time 7200;
# Show that we want to be the only DHCP server in this network:
authoritative;