net/dhcp
2026-03-31 08:35:08 +03:00

32 lines
622 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
cat > /etc/dhcp/dhcpd.conf << EOF
default-lease-time 600;
max-lease-time 7200;
authoritative;
subnet 192.168.4.0 netmask 255.255.255.248 {
range 192.168.4.2 192.168.4.6;
option domain-name-servers 192.168.3.2, 8.8.4.4;
option subnet-mask 255.255.255.248;
option routers 192.168.4.1;
}
host hq-cli {
hardware ethernet
08:00:27:c7:82:fa;
fixed-address
192.168.4.2;
}
EOF
chmod 600 /etc/dhcp/dhcpd.conf
cat > /etc/sysconfig/dhcpd << EOF
DHCPDARGS="enp0s9"
EOF
echo "_________________Перезагрузка и старт dncpd________________________"
systemctl restart dhcpd
systemctl start dhcpd