Per configurar el servidor DHCP he instalat el servei amb la comanda
apt-get install isc-dhcp-server I editar els següents arxius:
/etc/default/isc-dhcp-server : he afegit enp2s0.10 enp2s0.20 enp2s0.30 enp2s0.40 a la linea 17
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid
# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="enp2s0.10 enp2s0.20 enp2s0.30 enp2s0.40"
INTERFACESv6=""
/etc/dhcp/dhcpd.conf : per aquest document he afegit tot el que hi ha a partir de la linea 12, tot hi que he tingut alguns problemes amb la subxarxa CLIENT40
ddns-update-style none;
authoritative;
# Opciones generales
option domain-name "illa02";
default-lease-time 600;
max-lease-time 7200;
########################################
# SERV10
########################################
subnet 10.24.4.192 netmask 255.255.255.240 {
range 10.24.4.194 10.24.4.205;
option routers 10.24.4.193;
option broadcast-address 10.24.4.207;
host cristian {
hardware ethernet f8:e4:3b:3b:10:f3;
fixed-address 10.24.4.206;
}
}
########################################
# MANAGE20
########################################
subnet 10.24.4.128 netmask 255.255.255.192 {
range 10.24.4.130 10.24.4.189;
option routers 10.24.4.129;
option broadcast-address 10.24.4.191;
host hugo {
hardware ethernet 60:7d:09:0d:f0:0f;
fixed-address 10.24.4.190;
}
}
########################################
# LAB30
########################################
subnet 10.24.4.0 netmask 255.255.255.128 {
range 10.24.4.2 10.24.4.125;
option routers 10.24.4.1;
option broadcast-address 10.24.4.127;
host alex {
hardware ethernet 00:e0:4c:69:82:2c;
fixed-address 10.24.4.126;
}
}
########################################
# CLIENT40
########################################
subnet 10.24.2.0 netmask 255.255.254.0 {
range 10.24.2 10.24.3.253;
option routers 10.24.2.1;
option broadcast-address 10.24.3.255;
option domain-name-servers 8.8.8.8, 8.8.4.4;
host izan {
hardware ethernet 60:7d:09:0d:f0:aa;
fixed-address 10.24.3.254;
}
}
/etc/network/interfaces: aquí he fet les subxarxes a la segona targeta física seguint el pla d’adreçament i a la targeta de xarxa incorporada a la placa mare he assignat una IP fixa de a nostre subxarxa
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp1s0
iface enp1s0 inet static
address 172.25.209.12
netmask 255.255.0.0
gateway 172.25.130.254
# LAN - IP fija
# Interfaz física en modo manual
auto enp2s0
iface enp2s0 inet manual
auto enp2s0.10
iface enp2s0.10 inet static
address 10.24.4.193
netmask 255.255.255.240
vlan-raw-device enp2s0
auto enp2s0.20
iface enp2s0.20 inet static
address 10.124.4.129
netmask 255.255.255.192
vlan-raw-device enp2s0
auto enp2s0.30
iface enp2s0.30 inet static
address 10.24.4.1
netmask 255.255.255.128
vlan-raw-device enp2s0
auto enp2s0.40
iface enp2s0.40 inet static
address 10.24.2.1
netmask 255.255.254.0
vlan-raw-device enp2s0