Wifi のクライアント + アクセスポイント両方設定する場合、 仮想インタフェースを追加して対応します。
iw dev iw phy
sudo iw phy phy0 interface add <インタフェース名> type __ap
# hostapd が動いている場合停止させる。 systemctl stop hostapd
ip link set <インタフェース名> address <MACアドレス :区切り>
/etc/udev/rules.d/99-<devicename>.rules
SUBSYSTEM=="ieee80211", ACTION=="add|change", ATTR{macaddress}=="dc:a6:32:a8:e0:24", KERNEL=="phy0", \ RUN+="/sbin/iw phy phy0 interface add <デバイス名> type __ap", \ RUN+="/bin/ip link set <デバイス名> address <MACアドレス>"
sudo apt install dnsmasq
/etc/dnsmasq.conf
interface=<インタフェース名> dhcp-range=<開始IP>,<終了IP>,<時間> 例) interface=ap0 dhcp-range=172.16.1.100,172.16.1.200,12h
/etc/dhcpcd.conf
interface ap0 static ip_address=172.16.1.1/24 static routers=172.16.1.1 static domain_name_server=172.16.7.1 8.8.8.8 # wpa_supplicant を自動起動しないように。 nohook wpa_supplicant
/etc/hostapd/hostapd.conf
ctrl_interface=/var/run/hostapd ctrl_interface_group=0 interface=ap0 driver=nl80211 ssid=<SSID> hw_mode=g country_code=JP channel=6 ieee80211n=1 wmm_enabled=1 ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40] macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP wpa_passphrase=<パスフレーズ> rsn_pairwise=CCMP