systemd-networkd - Play AP on plugin of your USB WIFI Stick 
check wifi device name
~# ip addr | grep -A 5 wlan
10: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000

IP configuration of your Wifi Stick for systemd-networkd

/etc/systemd/network/hostapd.network
[Match]
Name=wlan0

[Network]
Address=192.168.0.1/24
DHCPServer=yes
IPMasquerade=true
IPForward=true

[DHCPServer]
PoolOffset=100
PoolSize=20
EmitDNS=yes
DNS=your_dns_server

Autostart of hostapd

/etc/system/hostapd.service.d/override.conf
[Unit]
Wants=systemd-networkd.service
Requires=sys-subsystem-net-devices-wlan0.device
After=sys-subsystem-net-devices-wlan0.device
BindsTo=sys-subsystem-net-devices-wlan0.device

[Install]
WantedBy=sys-subsystem-net-devices-wlan0.device
~# systemctrl enable hostapd
Autostop of hostapd

/etc/system/systemd-networkd.service.d/override.conf
[Unit]
After=hostapd.service
BindsTo=hostapd.service


[ view entry ] ( 39 views )   |  print article

| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next> Last>>