dhcp
sudo systemctl start isc-dhcp-server
udhcpd
Dnsmasq
cat > /tmp/dhcpd.conf << EOF
default-lease-time 600;
max-lease-time 7200;
subnet 10.10.10.0 netmask 255.255.255.0
{
range 10.10.10.52 10.10.10.250;
option domain-name-servers 8.8.8.8;
option routers 10.10.10.1;
}
EOF
sudo dhcpd wlan0 -cf /tmp/dhcpd.conf -pf /var/run/dhcp-server/dhcpd.pid
$ sudo apt install dnsmasq
# 编辑配置,在配置最后添加
$ sudo vi /etc/dnsmasq.conf
interface=wlan0
listen-address=10.10.10.1
dhcp-range=10.10.10.50,10.10.10.220,48h
# 重启 dnsmasq 服务
$ sudo systemctl restart dnsmasq.service