lakinduakash / linux-wifi-hotspot

Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. It is also able to create a hotspot using the same wifi card which is connected to an AP already ( Similar to Windows 10).
BSD 2-Clause "Simplified" License
3.37k stars 310 forks source link

Add option to create dhcp-host values into dnsmasq.conf #407

Closed dopplerreflect closed 2 months ago

dopplerreflect commented 5 months ago

Added --dhcp-hosts option to add dhcp-host= lines do dnsmasq.conf.

This allows us to set specified ip addresses for hosts connecting to the ap.

Sample result from my pi running NixOS:

# head -1 /nix/store/vdhr1snnzdjvdc04gn64jsqp6rqycf6a-create_ap.conf
DHCP_HOSTS=thinkpad,192.168.12.10 GW2000X,192.168.12.11
# cat /tmp/create_ap.wlan0.conf.ooKP4z5Q/dnsmasq.conf
listen-address=192.168.12.1
bind-dynamic
dhcp-range=192.168.12.1,192.168.12.254,255.255.255.0,24h
dhcp-option-force=option:router,192.168.12.1
dhcp-option-force=option:dns-server,192.168.12.1
dhcp-option-force=option:mtu,1500
dhcp-host=thinkpad,192.168.12.10
dhcp-host=GW2000X,192.168.12.11
lakinduakash commented 4 months ago

Waiting until documentation is updated

dopplerreflect commented 4 months ago

Apologies for the mess that is the diff in 01af6c8. Prettier on VSCode insisted on changing * to - and adding all the newlines under the headings, so I just went with it.

lakinduakash commented 2 months ago

Looks good. Thanks!