-
Notifications
You must be signed in to change notification settings - Fork 18
/
make_dumb_ap.sh
54 lines (37 loc) · 1.49 KB
/
make_dumb_ap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/ash
# Turn an OpenWrt router with factory settings into a dumb access point
# as outlined in https://openwrt.org/docs/guide-user/network/wifi/dumbap
# use at your own risk !!!!
# backup your router first !!!!
# script expects factory settings !!!!
# these services do not run on dumb APs
for i in firewall dnsmasq odhcpd; do
if /etc/init.d/"$i" enabled; then
/etc/init.d/"$i" disable
/etc/init.d/"$i" stop
fi
done
# Now switch the lan interface to DHCP client
uci set network.lan.proto='dhcp'
uci delete network.wan
uci delete network.wan6
uci delete network.lan.ipaddr
uci delete network.lan.netmask
# change the host name to "WifiAP"
uci set system.@system[0].hostname='WifiAP'
echo '#####################################################################'
echo 'the script has disabled firewall, dns and dhcp server on this device'
echo 'and switched the protocol of the lan interface to dhcp client'
echo 'you can now connect the LAN port of this device to the LAN port'
echo 'of your main Router. Check the IP address of the WifiAP system'
echo 'and connect to that new IP address in order to run the'
echo 'second script. This device is now rebooting'
echo 'the host name of the device is now WifiAP, so you might also'
echo 'try ping WifiAP or ssh WifiAP or the like'
echo '#####################################################################'
# commit all changes
uci commit
# remove the firewall config
mv /etc/config/firewall /etc/config/firewall.unused
# reboot the device
reboot