From 562fe5393695d8bde50018b5a9315a2f18ab94c2 Mon Sep 17 00:00:00 2001 From: Astro Date: Tue, 24 Apr 2018 21:17:59 +0200 Subject: [PATCH] cpe: prepare TL-Archer-C7v4 switching config --- salt-pillar/cpe/aps.sls | 3 +-- salt/cpe/ap.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/salt-pillar/cpe/aps.sls b/salt-pillar/cpe/aps.sls index bc6dfd6..dfab5cb 100644 --- a/salt-pillar/cpe/aps.sls +++ b/salt-pillar/cpe/aps.sls @@ -1081,7 +1081,6 @@ cpe: net: pub ap29: - firstboot: true password: | -----BEGIN PGP MESSAGE----- @@ -1095,7 +1094,7 @@ cpe: Axz/Dd5jCt1Nmv2RUCF+vQ== =2Fj1 -----END PGP MESSAGE----- - model: TL-Archer-C7v2 + model: TL-Archer-C7v4 version: nightly location: B1.05.07 lan-access: priv13 diff --git a/salt/cpe/ap.sh b/salt/cpe/ap.sh index 3eb7f47..52645e5 100644 --- a/salt/cpe/ap.sh +++ b/salt/cpe/ap.sh @@ -169,6 +169,41 @@ set network.{{ net }}.ifname='eth0.{{ pillar['vlans'][net] }}' {%- endif %} {%- endfor %} +{%- elif conf['model'] == 'TL-Archer-C7v4' %} +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='0t 1t' +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: eth0; 1: WAN port; 2-5: LAN ports +{%- if conf.get('lan-access') == net %} +set network.@switch_vlan[{{ switchnum }}].ports='0t 1t 2 3 4 5' +{%- else %} +set network.@switch_vlan[{{ switchnum }}].ports='0t 1t' +{%- endif %} +set network.@switch_vlan[{{ switchnum }}].comment='{{ net }}' +{% set switchnum = switchnum + 1 %} +{%- endfor %} + +{{ uci_network_mgmt('eth0.1') }} + +{%- for net in bridges.keys() %} +set network.{{ net }}=interface +set network.{{ net }}.type=bridge +set network.{{ net }}.proto=static +set network.{{ net }}.ifname='eth0.{{ pillar['vlans'][net] }}' +{%- endfor %} + {%- elif conf['model'] == 'TL-WR841Nv8' %} {# Like v9 but with eth0/1 switched #} set network.@switch[0].reset=1