forked from onemarcfifty/openwrt-mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_mesh_point.sh
69 lines (54 loc) · 1.81 KB
/
make_mesh_point.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/ash
# Turn an OpenWrt dumb access point into a Wi-fi mesh point
# use at your own risk !!!!
# backup your router first !!!!
# script expects factory settings+1st script to be executed!!!!
# the script might not run on all hardware !!!
# ######################
# you may customize this
# ######################
MESH_NAME="my_mesh"
MESH_PWD="T0psecret"
MESH_RADIO=radio0
MESH_CHANNEL=1
WIFI_NAME="my_wifi"
WIFI_PWD="SuperSecret"
WIFI_RADIO=radio1
WIFI_CHANNEL=36
WIFI_MOBDOMAIN='1234'
# install the wpad mesh package
opkg update
opkg install --force-overwrite wpad-mesh-openssl
# delete the "OpenWrt" radios
uci delete wireless.default_radio0
uci delete wireless.default_radio1
# create the mesh Wifi
uci set wireless.wifinet0=wifi-iface
uci set wireless.wifinet0.device=$MESH_RADIO
uci set wireless.wifinet0.mode='mesh'
uci set wireless.wifinet0.encryption='sae'
uci set wireless.wifinet0.mesh_id=$MESH_NAME
uci set wireless.wifinet0.mesh_fwding='1'
uci set wireless.wifinet0.mesh_rssi_threshold='0'
uci set wireless.wifinet0.key=$MESH_PWD
uci set wireless.wifinet0.network='lan'
uci set "wireless.$MESH_RADIO.channel"=$MESH_CHANNEL
uci delete "wireless.$MESH_RADIO.disabled"
# create the AP Wifi
uci set wireless.wifinet1=wifi-iface
uci set wireless.wifinet1.device=$WIFI_RADIO
uci set wireless.wifinet1.mode='ap'
uci set wireless.wifinet1.ssid=$WIFI_NAME
uci set wireless.wifinet1.encryption='psk2'
uci set wireless.wifinet1.key=$WIFI_PWD
uci set wireless.wifinet1.ieee80211r='1'
uci set wireless.wifinet1.mobility_domain=$WIFI_MOBDOMAIN
uci set wireless.wifinet1.ft_over_ds='0'
uci set wireless.wifinet1.ft_psk_generate_local='1'
uci set wireless.wifinet1.network='lan'
uci set "wireless.$WIFI_RADIO.channel"=$WIFI_CHANNEL
uci delete "wireless.$WIFI_RADIO.disabled"
uci commit
wifi down
/etc/init.d/wpad restart
wifi up