sudo touch /etc/init.d/start-wifi.sh
sudo chmod +x /etc/init.d/start-wifi.sh
sudo update-rc.d start-wifi.sh defaults 99
sudo gedit /etc/init.d/start-wifi.sh
встав
#!/bin/bash
if [ "$1" == "start" ];then
# Start
# Configure IP address for WLAN
ifconfig wlan0 192.168.150.1
# Start DHCP/DNS server
service dnsmasq restart
# Enable routing
sysctl net.ipv4.ip_forward=1
# Enable NAT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# Run access point daemon
hostapd /etc/hostapd.conf
fi
if [ "$1" == "stop" ];then
# Stop
# Disable NAT
iptables -D POSTROUTING -t nat -o eth0 -j MASQUERADE
# Disable routing
sysctl net.ipv4.ip_forward=0
# Disable DHCP/DNS server
service dnsmasq stop
fi
сохранить и перезагрузка.