net/dhcp
2026-03-17 14:28:15 +05:00

32 lines
621 B
Plaintext
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/nash
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 172.16.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