From 35da64f48117bbcb472adc8f5b9177c2551a725e Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 11 May 2017 21:05:04 +0200 Subject: [PATCH] cpe: implement TL-WR740N, prepare ap22 --- salt-pillar/cpe/aps.sls | 27 +++++++++++++++++++++++++++ salt/cpe/ap.sh | 25 +++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/salt-pillar/cpe/aps.sls b/salt-pillar/cpe/aps.sls index 51910a8..d920adb 100644 --- a/salt-pillar/cpe/aps.sls +++ b/salt-pillar/cpe/aps.sls @@ -770,3 +770,30 @@ cpe: 4o42SHID =2Z0a -----END PGP MESSAGE----- + + ap22: + firstboot: True + password: | + -----BEGIN PGP MESSAGE----- + + hQEMA2PKcvDMvlKLAQf9F7poRfXff8fN2TwFGms3xsHsbSWJ6E9qHY9JFJFcXNHl + Oj9Q/gVOswnCp2SS1QLIR6vgwq8sZLyXqH9RRNx0hQdocf31siSY6H/9xVb+ZNPH + 9wt4Z8iXD+TQ0ZC6jA7I6EDjQ+rx+KNBA2Yslx1/Pgg7F6yAlw46c0r16SBu+uEt + qaodWJDLccURGd22YMzsgjOlSWsoSezOsO73FhMFuA8KcYHxeYGt6YkqD0XTe83v + 57WG8q58CKQuJiY2zV/sk8N+jXuzMGM1N1N9H0sIM2QvnQbPaDc0W/e2CmN8Z99A + +NOqn2QZhKecDww668OC7M1LS3MEoa4nB4LCpuzvk9JKAfQkgqYUTyqjsmzuSME+ + 3BaKQrUAL7IEbPEkErlG0xajyxO9TGFMFoIeS/uM5C/e6ro+bEa26nEioZbWbTTR + FSvjD9EhotSZf4I= + =zomB + -----END PGP MESSAGE----- + + model: TL-WR740N + location: Turm C Erdgeschoss? + lan-access: pub + radios: + 'platform/qca953x_wmac': + channel: 11 + htmode: HT40- + ssids: + 'ZW public': + net: pub diff --git a/salt/cpe/ap.sh b/salt/cpe/ap.sh index e1a5192..ea16177 100644 --- a/salt/cpe/ap.sh +++ b/salt/cpe/ap.sh @@ -192,6 +192,31 @@ set network.{{ net }}.proto=static set network.{{ net }}.ifname='{{ ' '.join(ports) }}' {%- endfor %} +{%- elif conf['model'] == 'TL-WR740Nv4' %} +{# Separate eth0/1 interfaces for LAN/WAN #} +{# eth0 - Port 0: eth0, Port 2: LAN1, Port 3: LAN2, Port 4: LAN3, Port 1: LAN4 #} +{# eth1 - WAN #} +set network.@switch[0].reset=1 +set network.@switch[0].enable=1 +set network.@switch[0].enable_vlan=0 + +{{ uci_network_mgmt('eth1.1') }} + +{%- for net in bridges.keys() %} + +set network.{{ net }}=interface +set network.{{ net }}.type=bridge +set network.{{ net }}.proto=static +{# Add WAN VLAN to bridge #} +{%- set ports = ['eth1.' ~ pillar['vlans'][net]] %} +{# Add LAN ports to bridge #} +{%- if conf.get('lan-access') == net %} +{%- do ports.append('eth0') %} +{%- endif %} + +set network.{{ net }}.ifname='{{ ' '.join(ports) }}' +{%- endfor %} + {%- elif conf['model'] == 'TL-WA901NDv3' or conf['model'] == 'Ubnt-UniFi-AP-AC-LR' %} {# Only eth0 exists, no switch #}