0

I've set up an access point / wifi-repeater via hostapd on my raspberry pi using this incredible tutorial.

Now I want to ensure that the connecting clients have a "static" IP in the subnet. Example:

  • Client with MAC 0d:78:b9:5c:1d:b6 connects to the AP.
  • The client is assigned the IP 192.168.4.200

How can I ensure that the assigned sub-IP (.200) is always the same? Will it change randomly after a few connections? Can I somehow map specific IPs to the connecting MACs?

I've read about accept_mac_file and VLAN, but I am unsure if this solves my issue.

  • 1
    I thought that you would generally set up a DHCP server (like [dnsmasq](https://thekelleys.org.uk/dnsmasq/doc.html)) to handle address assignment when using hostapd. Tjen you would just add static host entries to your DHCP server configuration. E.g., based on the instructions in [this article](https://hawksites.newpaltz.edu/myerse/2018/06/08/hostapd-on-raspberry-pi/) and the following one [here](https://hawksites.newpaltz.edu/myerse/2018/06/19/dhcp-daemon-on-raspberry-pi/) (that article uses the ISC DHCP Server; I would suggest sticking with dnsmasq in most cases because it's simpler). – larsks Aug 28 '22 at 01:45
  • @larsks thanks for the idea, I will give it a try. But `dnsmasq` has previously bricked my configuration, so I will use caution, still searching for a solution with `hostapd` only. – Sebastian Schneider Aug 28 '22 at 14:04

0 Answers0