From bdf0ef9a58055fef67eed60337efe3f0725a8dc5 Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 11 Dec 2016 01:44:22 +0100 Subject: [PATCH] cpe: prepare TL-Archer-C7v2 config, deploy ap3 --- salt-pillar/cpe/aps.sls | 12 +++++------ salt/cpe/ap.sh | 44 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/salt-pillar/cpe/aps.sls b/salt-pillar/cpe/aps.sls index 9ece670..c4d5d0a 100644 --- a/salt-pillar/cpe/aps.sls +++ b/salt-pillar/cpe/aps.sls @@ -57,13 +57,13 @@ cpe: =Tlu+ -----END PGP MESSAGE----- - model: TL-WDR4300 # TL-Archer-C7 + model: TL-Archer-C7v2 location: Netzbiotop Main lan-access: priv1 radios: - radio0: - channel: 1 - htmode: HT40+ + 'platform/qca955x_wmac': + channel: 11 + htmode: HT40- ssids: 'ZW public': net: pub @@ -82,9 +82,9 @@ cpe: rA== =TEEI -----END PGP MESSAGE----- - radio1: + 'pci0000:01/0000:01:00.0': channel: 36 - htmode: HT40+ + htmode: VHT80 ssids: 'ZW public': net: pub diff --git a/salt/cpe/ap.sh b/salt/cpe/ap.sh index d245991..5c0e96c 100644 --- a/salt/cpe/ap.sh +++ b/salt/cpe/ap.sh @@ -120,6 +120,50 @@ set network.{{ net }}.ifname='eth0.{{ pillar['vlans'][net] }}' {%- endif %} {%- endfor %} +{%- elif conf['model'] == 'TL-Archer-C7v2' %} +{# These models have a shared Ethernet chip with separate CPU ports for LAN/WAN and therefore need switching #} +set network.@switch[0]=switch +set network.@switch[0].reset=1 +set network.@switch[0].enable=1 +set network.@switch[0].enable_vlan=1 +set network.@switch[0].name=switch0 +set network.@switch_vlan[0]=switch_vlan +set network.@switch_vlan[0].device='switch0' +set network.@switch_vlan[0].vlan='1' +set network.@switch_vlan[0].ports='1t 6t' +set network.@switch_vlan[0].comment='mgmt' +{% set switchnum = 1 %} +{%- for net in bridges.keys() %} +set network.@switch_vlan[{{ switchnum }}]=switch_vlan +set network.@switch_vlan[{{ switchnum }}].device='switch0' +set network.@switch_vlan[{{ switchnum }}].vlan='{{ pillar['vlans'][net] }}' +# 0: eth1; 1: WAN port; 2-5: LAN ports; 6: eth0 +{%- if conf.get('lan-access') == net %} +set network.@switch_vlan[{{ switchnum }}].ports='0 1t 2 3 4 5' +{%- else %} +set network.@switch_vlan[{{ switchnum }}].ports='1t 6t' +{%- endif %} +set network.@switch_vlan[{{ switchnum }}].comment='{{ net }}' +{% set switchnum = switchnum + 1 %} +{%- endfor %} + +set network.mgmt=interface +set network.mgmt.ifname=eth0.1 +set network.mgmt.proto=static +set network.mgmt.ipaddr={{ pillar['hosts-inet']['mgmt'][hostname] }} +set network.mgmt.netmask=255.255.255.0 + +{%- for net in bridges.keys() %} +set network.{{ net }}=interface +set network.{{ net }}.type=bridge +set network.{{ net }}.proto=static +{%- if conf.get('lan-access') == net %} +set network.{{ net }}.ifname='eth1' +{%- else %} +set network.{{ net }}.ifname='eth0.{{ pillar['vlans'][net] }}' +{%- endif %} +{%- endfor %} + {%- else %} {# All other models may have separate Ethernet chips for LAN/WAN #} set network.@switch[0].reset=1