|
3 | 3 | /etc/init.d/wpad stop |
4 | 4 |
|
5 | 5 | iw phy phy0 interface add wifi0 type __ap |
| 6 | +iw phy phy0 interface add wifi0.1 type __ap |
| 7 | +iw phy phy0 interface add wifi0.2 type __ap |
6 | 8 | iw phy phy0 interface add wifi1 type __ap |
7 | 9 | iw phy phy0 interface add wifi1.1 type __ap |
8 | 10 | iw phy phy0 interface add wifi1.2 type __ap |
| 11 | +iw phy phy0 interface add wifi1.3 type __ap |
9 | 12 | iw phy phy0 interface add wifi2 type __ap |
| 13 | +#iw phy phy0 interface add wifi2.1 type __ap |
| 14 | +#iw phy phy0 interface add wifi2.2 type __ap |
10 | 15 |
|
11 | 16 | #Derive the initial wifi mac address from eth0 or erouter0 address |
12 | 17 | #as they are unique for each Banana PI |
|
28 | 33 | fi |
29 | 34 |
|
30 | 35 | #Obtain the wifi0 mac address from primary_wifi_mac by converting to str format |
31 | | -wifi0_mac=$(printf "%012x" $primary_wifi_mac | sed 's/../&:/g;s/:$//') |
32 | | -#Increment primary_wifi_mac by 1 to get wifi1_mac |
33 | | -mac_incr=$(($primary_wifi_mac + 1)) |
| 36 | +mac_incr=$(($primary_wifi_mac + 0)) |
| 37 | +wifi0_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') |
| 38 | +#Increment again by 1 to get wifi0.1_mac |
| 39 | +mac_incr=$(($mac_incr + 1)) |
| 40 | +wifi0_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') |
| 41 | +#Increment again by 1 to get wifi0.2_mac |
| 42 | +mac_incr=$(($mac_incr + 1)) |
| 43 | +wifi0_2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') |
| 44 | +#Increment primary_wifi_mac by 0x10 (decimal 16) to get wifi1 address |
| 45 | +mac_incr=$(($primary_wifi_mac + 16)) |
34 | 46 | wifi1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') |
35 | 47 | #Increment again by 1 to get wifi1.1 address |
36 | 48 | mac_incr=$(($mac_incr + 1)) |
37 | 49 | wifi1_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') |
38 | 50 | #Increment again by 1 to get wifi1.2 address |
39 | 51 | mac_incr=$(($mac_incr + 1)) |
40 | 52 | wifi1_2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') |
41 | | -#Increment again by 1 to get wifi2 address |
| 53 | +#Increment again by 1 to get wifi1.3 address |
42 | 54 | mac_incr=$(($mac_incr + 1)) |
| 55 | +wifi1_3_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') |
| 56 | +#Increment primary_wifi_mac by 0x20 (decimal 32) to get wifi2 address |
| 57 | +mac_incr=$(($primary_wifi_mac + 32)) |
43 | 58 | wifi2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') |
| 59 | +#Increment again by 1 to get wifi2.1 address |
| 60 | +#mac_incr=$(($mac_incr + 1)) |
| 61 | +#wifi2_1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') |
| 62 | +#Increment again by 1 to get wifi2.2 address |
| 63 | +#mac_incr=$(($mac_incr + 1)) |
| 64 | +#wifi2_2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//') |
44 | 65 | #print the mac address |
45 | 66 | echo $wifi0_mac |
| 67 | +echo $wifi0_1_mac |
| 68 | +echo $wifi0_2_mac |
46 | 69 | echo $wifi1_mac |
47 | 70 | echo $wifi1_1_mac |
48 | 71 | echo $wifi1_2_mac |
| 72 | +echo $wifi1_3_mac |
49 | 73 | echo $wifi2_mac |
| 74 | +#echo $wifi2_1_mac |
| 75 | +#echo $wifi2_2_mac |
50 | 76 |
|
51 | 77 | #Update the mac address using ip link command |
52 | 78 | ifconfig wifi0 down |
| 79 | +ifconfig wifi0.1 down |
| 80 | +ifconfig wifi0.2 down |
53 | 81 | ifconfig wifi1 down |
54 | 82 | ifconfig wifi1.1 down |
55 | 83 | ifconfig wifi1.2 down |
| 84 | +ifconfig wifi1.3 down |
56 | 85 | ifconfig wifi2 down |
| 86 | +#ifconfig wifi2.1 down |
| 87 | +#ifconfig wifi2.2 down |
57 | 88 | ip link set dev wifi0 address $wifi0_mac |
| 89 | +ip link set dev wifi0.1 address $wifi0_1_mac |
| 90 | +ip link set dev wifi0.2 address $wifi0_2_mac |
58 | 91 | ip link set dev wifi1 address $wifi1_mac |
59 | 92 | ip link set dev wifi1.1 address $wifi1_1_mac |
60 | 93 | ip link set dev wifi1.2 address $wifi1_2_mac |
| 94 | +ip link set dev wifi1.3 address $wifi1_3_mac |
61 | 95 | ip link set dev wifi2 address $wifi2_mac |
| 96 | +#ip link set dev wifi2.1 address $wifi2_1_mac |
| 97 | +#ip link set dev wifi2.2 address $wifi2_2_mac |
62 | 98 | ifconfig wifi0 up |
| 99 | +ifconfig wifi0.1 up |
| 100 | +ifconfig wifi0.2 up |
63 | 101 | ifconfig wifi1 up |
64 | 102 | ifconfig wifi1.1 up |
65 | 103 | ifconfig wifi1.2 up |
| 104 | +ifconfig wifi1.3 up |
66 | 105 | ifconfig wifi2 up |
| 106 | +#ifconfig wifi2.1 up |
| 107 | +#ifconfig wifi2.2 up |
67 | 108 |
|
68 | 109 |
|
69 | 110 | #Copy configuration file to nvram |
70 | 111 | mkdir -p /nvram |
71 | 112 | cp InterfaceMap.json /nvram/. |
72 | 113 |
|
73 | 114 | # Create the EasyMeshCfg.json which will have the al_mac_address |
74 | | -# same as that of wifi_1_1_mac |
75 | | -al_mac_addr=$wifi1_1_mac |
| 115 | +# same as that of sta wifi_1_3_mac |
| 116 | +al_mac_addr=$wifi1_3_mac |
76 | 117 | colocated_mode=0 |
77 | 118 | backhaul_ssid="mesh_backhaul" |
78 | 119 | backhaul_keypassphrase="test-backhaul" |
|
0 commit comments