net/dhcp
2026-03-12 13:44:01 +05:00

31 lines
521 B
Plaintext
Executable file

#!/bin/nash
cat > /etc/dhcp/dhcpd.conf << EOF
default-lease-time 600;
max-lease-time 7200;
authoritative;
subnet 192.168.3.0 netmask 255.255.255.248 {
range 192.168.3.1 192.168.3.6;
option domain-name-servers 8.8.8.8, 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="enp0s8"
EOF
systemctl enable dhcp
systemctl start dhcp