Wireless switch automation script

Signed-off-by: mharb <mharb@noreply.localhost>
This commit is contained in:
mharb 2025-07-05 20:15:21 -04:00
parent 5c1f6651a6
commit 862c906295

7
wifi-init.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
#Configure the current machine as a wireless access point
echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf && sysctl -p
ip addr add 192.168.2.1/24 dev wlp2s0 && ip link set wlp2s0 up
iptables-save && iptables-restore < /etc/iptables/rules-save
dnsmasq && hostapd -B /etc/hostapd/hostapd.conf
iptables -P FORWARD ACCEPT