| 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (C) 2011 OpenWrt.org |
| 4 | # |
| 5 | |
| 6 | [ -e /etc/config/network ] && exit 0 |
| 7 | |
| 8 | touch /etc/config/network |
| 9 | |
| 10 | . /lib/functions/uci-defaults.sh |
| 11 | . /lib/ar71xx.sh |
| 12 | |
| 13 | ucidef_set_interface_loopback |
| 14 | |
| 15 | board=$(ar71xx_board_name) |
| 16 | |
| 17 | case "$board" in |
| 18 | all0315n |\ |
| 19 | all0258n |\ |
| 20 | ja76pf2) |
| 21 | ucidef_set_interface_lan "eth0 eth1" |
| 22 | ;; |
| 23 | |
| 24 | db120 |\ |
| 25 | rb-2011l | \ |
| 26 | rb-2011uas-2hnd) |
| 27 | ucidef_set_interfaces_lan_wan "eth0.1 eth1" "eth0.2" |
| 28 | ucidef_add_switch "eth0" "1" "1" |
| 29 | ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5" |
| 30 | ucidef_add_switch_vlan "eth0" "2" "0t 1" |
| 31 | ucidef_add_switch "eth1" "1" "1" |
| 32 | ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5" |
| 33 | ;; |
| 34 | |
| 35 | dir-825-b1|\ |
| 36 | tew-673gru) |
| 37 | ucidef_set_interfaces_lan_wan "eth0.1" "eth1" |
| 38 | ucidef_add_switch "rtl8366s" "1" "1" |
| 39 | ucidef_add_switch_vlan "rtl8366s" "1" "0 1 2 3 5t" |
| 40 | ;; |
| 41 | |
| 42 | nbg460n_550n_550nh) |
| 43 | ucidef_set_interfaces_lan_wan "eth0" "eth1" |
| 44 | ucidef_add_switch "rtl8366s" "1" "1" |
| 45 | ucidef_add_switch_vlan "rtl8366s" "0" "0 1 2 3 5" |
| 46 | ;; |
| 47 | |
| 48 | rb-433 |\ |
| 49 | rb-433u) |
| 50 | ucidef_set_interfaces_lan_wan "eth1" "eth0" |
| 51 | ucidef_add_switch "switch0" "1" "1" |
| 52 | ucidef_add_switch_vlan "switch0" "1" "1 2 5" |
| 53 | ;; |
| 54 | |
| 55 | rb-450) |
| 56 | ucidef_set_interfaces_lan_wan "eth1" "eth0" |
| 57 | ucidef_add_switch "eth1" "1" "1" |
| 58 | ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 5" |
| 59 | ;; |
| 60 | |
| 61 | rb-450g |\ |
| 62 | routerstation-pro) |
| 63 | ucidef_set_interfaces_lan_wan "eth1" "eth0" |
| 64 | ucidef_add_switch "switch0" "1" "1" |
| 65 | ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4" |
| 66 | ;; |
| 67 | |
| 68 | ap136 |\ |
| 69 | rb-750gl |\ |
| 70 | rb-751g |\ |
| 71 | wzr-hp-g450h) |
| 72 | ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" |
| 73 | ucidef_add_switch "switch0" "1" "1" |
| 74 | ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5" |
| 75 | ucidef_add_switch_vlan "switch0" "2" "0t 1" |
| 76 | ;; |
| 77 | |
| 78 | rb-493g) |
| 79 | ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2" |
| 80 | ucidef_add_switch "switch0" "1" "1" |
| 81 | ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4" |
| 82 | ucidef_add_switch "switch1" "1" "1" |
| 83 | ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4" |
| 84 | ucidef_add_switch_vlan "switch1" "2" "0t 5" |
| 85 | ;; |
| 86 | |
| 87 | wzr-hp-g300nh2 |\ |
| 88 | pb92 |\ |
| 89 | ap113) |
| 90 | ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" |
| 91 | ucidef_add_switch "eth0" "1" "1" |
| 92 | ucidef_add_switch_vlan "eth0" "1" "0t 1 3 4 5" |
| 93 | ucidef_add_switch_vlan "eth0" "2" "0t 2" |
| 94 | ;; |
| 95 | |
| 96 | tl-wdr4300|\ |
| 97 | tl-wr1041n-v2) |
| 98 | ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" |
| 99 | ucidef_add_switch "eth0" "1" "1" |
| 100 | ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5" |
| 101 | ucidef_add_switch_vlan "eth0" "2" "0t 1" |
| 102 | ;; |
| 103 | |
| 104 | tl-wr1043nd) |
| 105 | ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" |
| 106 | ucidef_add_switch "rtl8366rb" "1" "1" |
| 107 | ucidef_add_switch_vlan "rtl8366rb" "1" "1 2 3 4 5t" |
| 108 | ucidef_add_switch_vlan "rtl8366rb" "2" "0 5t" |
| 109 | ;; |
| 110 | |
| 111 | tl-wr2543n) |
| 112 | ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" |
| 113 | ucidef_add_switch "switch0" "1" "1" |
| 114 | ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t" |
| 115 | ucidef_add_switch_vlan "switch0" "2" "0 9t" |
| 116 | ;; |
| 117 | |
| 118 | tl-wr841n-v1|\ |
| 119 | tl-wr941nd) |
| 120 | ucidef_set_interface_raw "eth" "eth0" |
| 121 | ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" |
| 122 | ;; |
| 123 | |
| 124 | tl-wr841n-v8) |
| 125 | ucidef_set_interfaces_lan_wan "eth1" "eth0" |
| 126 | ucidef_add_switch "switch0" "1" "1" |
| 127 | ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4" |
| 128 | ;; |
| 129 | |
| 130 | wrt160nl) |
| 131 | ucidef_set_interfaces_lan_wan "eth0" "eth1" |
| 132 | ucidef_add_switch "eth0" "1" "1" |
| 133 | ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5" |
| 134 | ;; |
| 135 | |
| 136 | wzr-hp-g300nh) |
| 137 | ucidef_set_interfaces_lan_wan "eth0.1" "eth1" |
| 138 | ucidef_add_switch "switch0" "1" "1" |
| 139 | ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t" |
| 140 | ;; |
| 141 | |
| 142 | all0305 |\ |
| 143 | aw-nr580 |\ |
| 144 | bullet-m |\ |
| 145 | eap7660d |\ |
| 146 | ew-dorin |\ |
| 147 | rb-411 |\ |
| 148 | tl-mr11u |\ |
| 149 | tl-mr3020 |\ |
| 150 | tl-mr3040 |\ |
| 151 | tl-wa901nd |\ |
| 152 | tl-wa901nd-v2 |\ |
| 153 | tl-wr703n |\ |
| 154 | wp543) |
| 155 | ucidef_set_interface_lan "eth0" |
| 156 | ;; |
| 157 | |
| 158 | alfa-ap96 |\ |
| 159 | alfa-nx |\ |
| 160 | ap83 |\ |
| 161 | jwap003 |\ |
| 162 | pb42 |\ |
| 163 | pb44 |\ |
| 164 | routerstation|\ |
| 165 | wpe72) |
| 166 | ucidef_set_interfaces_lan_wan "eth1" "eth0" |
| 167 | ;; |
| 168 | |
| 169 | ap121 |\ |
| 170 | ap121-mini |\ |
| 171 | ap96 |\ |
| 172 | airrouter |\ |
| 173 | dir-600-a1 |\ |
| 174 | dir-615-c1 |\ |
| 175 | dir-615-e4 |\ |
| 176 | ja76pf |\ |
| 177 | rb-750 |\ |
| 178 | rb-751 |\ |
| 179 | tew-632brp |\ |
| 180 | tew-712br |\ |
| 181 | tl-mr3220 |\ |
| 182 | tl-mr3420 |\ |
| 183 | tl-wr741nd |\ |
| 184 | tl-wr741nd-v4 |\ |
| 185 | tl-wr841n-v7 |\ |
| 186 | whr-g301n |\ |
| 187 | whr-hp-g300n |\ |
| 188 | whr-hp-gn |\ |
| 189 | wzr-hp-ag300h) |
| 190 | ucidef_set_interfaces_lan_wan "eth0" "eth1" |
| 191 | ucidef_add_switch "eth0" "1" "1" |
| 192 | ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4" |
| 193 | ;; |
| 194 | |
| 195 | wzr-hp-g450h) |
| 196 | ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" |
| 197 | ucidef_add_switch "eth0" "1" "1" |
| 198 | ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5" |
| 199 | ucidef_add_switch_vlan "eth0" "2" "0t 1" |
| 200 | ;; |
| 201 | |
| 202 | ew-dorin-router) |
| 203 | ucidef_set_interfaces_lan_wan "eth0" "eth1" |
| 204 | ucidef_add_switch "eth0" "1" "1" |
| 205 | ucidef_add_switch_vlan "eth0" "1" "0 2 3" |
| 206 | ;; |
| 207 | |
| 208 | *) |
| 209 | ucidef_set_interfaces_lan_wan "eth0" "eth1" |
| 210 | ;; |
| 211 | esac |
| 212 | |
| 213 | uci commit network |
| 214 | |
| 215 | exit 0 |
| 216 | |