cpe: TL-WDR4300

This commit is contained in:
Astro 2016-11-29 16:18:35 +01:00
parent 0a078d5115
commit 4f6da292be
2 changed files with 55 additions and 24 deletions

View File

@ -16,13 +16,13 @@ cpe:
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
model: TL-WR841N model: TL-WR841N
location: abhanden location: abhanden
access-ports: pub lan-access: pub
radios: radios:
'platform/qca953x_wmac': 'platform/qca953x_wmac':
channel: 1 channel: 1
htmode: HT40+ htmode: HT40+
ssids: ssids:
'Zentralwerk': 'ZW public':
net: pub net: pub
'C3D2 legacy': 'C3D2 legacy':
net: priv1 net: priv1
@ -57,14 +57,15 @@ cpe:
=Tlu+ =Tlu+
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
model: TL-Archer-C7 model: TL-WDR4300 # TL-Archer-C7
location: Netzbiotop Main location: Netzbiotop Main
access-ports: priv1 lan-access: priv1
radios: radios:
radio0: radio0:
channel: 1 channel: 1
htmode: HT40+
ssids: ssids:
'Zentralwerk': 'ZW public':
net: pub net: pub
'C3D2 legacy': 'C3D2 legacy':
net: priv1 net: priv1
@ -82,9 +83,10 @@ cpe:
=TEEI =TEEI
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
radio1: radio1:
channel: 130 channel: 36
htmode: HT40+
ssids: ssids:
'Zentralwerk': 'ZW public':
net: pub net: pub
'C3D2': 'C3D2':
net: priv1 net: priv1
@ -103,7 +105,6 @@ cpe:
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
ap3: ap3:
firstboot: true
password: | password: |
-----BEGIN PGP MESSAGE----- -----BEGIN PGP MESSAGE-----
@ -118,14 +119,15 @@ cpe:
=kpf2 =kpf2
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
model: TL-WR1043ND model: TL-WDR4300
location: weg location: weg
access-ports: priv1 lan-access: priv1
radios: radios:
radio0: 'platform/ar934x_wmac':
channel: 1 channel: 6
htmode: HT40+
ssids: ssids:
'Zentralwerk': 'ZW public':
net: pub net: pub
'C3D2 legacy': 'C3D2 legacy':
net: priv1 net: priv1
@ -142,10 +144,11 @@ cpe:
rA== rA==
=TEEI =TEEI
-----END PGP MESSAGE----- -----END PGP MESSAGE-----
radio1: 'pci0000:00/0000:00:00.0':
channel: 130 channel: 36
htmode: HT40+
ssids: ssids:
'Zentralwerk': 'ZW public':
net: pub net: pub
'C3D2': 'C3D2':
net: priv1 net: priv1

View File

@ -27,19 +27,46 @@ delete network.wan6
delete wireless.default_radio0 delete wireless.default_radio0
delete wireless.default_radio1 delete wireless.default_radio1
{%- if conf['model'] == 'TL-WDR4300' %}
# These models have a shared Ethernet chip 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='0t 2 3 4 5'
set network.@switch_vlan[0].comment='LAN ports'
set network.@switch_vlan[1]=switch_vlan
set network.@switch_vlan[1].device='switch0'
set network.@switch_vlan[1].vlan='2'
set network.@switch_vlan[1].ports='0t 1'
set network.@switch_vlan[1].comment='WAN port'
{%- set lan_port = 'eth0.1' %}
{%- set wan_port = 'eth0.2' %}
{%- else %}
# All other models may have separate Ethernet chips for LAN/WAN
set network.@switch[0].reset=1 set network.@switch[0].reset=1
set network.@switch[0].enable=1 set network.@switch[0].enable=1
set network.@switch[0].enable_vlan=0 set network.@switch[0].enable_vlan=0
{%- set lan_port = 'eth0' %}
{%- set wan_port = 'eth1' %}
{%- endif %}
set network.mgmt=interface set network.mgmt=interface
set network.mgmt.ifname=eth1.1 set network.mgmt.ifname={{ wan_port }}.1
set network.mgmt.proto=static set network.mgmt.proto=static
set network.mgmt.ipaddr={{ pillar['hosts-inet']['mgmt'][hostname] }} set network.mgmt.ipaddr={{ pillar['hosts-inet']['mgmt'][hostname] }}
set network.mgmt.netmask=255.255.255.0 set network.mgmt.netmask=255.255.255.0
{%- set bridges = {} %} {%- set bridges = {} %}
{%- if conf.get('access-ports') %} {%- if conf.get('lan-access') %}
{%- do bridges.__setitem__(conf['access-ports'], True) %} {%- do bridges.__setitem__(conf['lan-access'], True) %}
{%- endif %} {%- endif %}
{%- for path, radio in conf['radios'].items() %} {%- for path, radio in conf['radios'].items() %}
{%- for ssid, ssidconf in radio['ssids'].items() %} {%- for ssid, ssidconf in radio['ssids'].items() %}
@ -52,14 +79,15 @@ set network.mgmt.netmask=255.255.255.0
set network.{{ net }}=interface set network.{{ net }}=interface
set network.{{ net }}.type=bridge set network.{{ net }}.type=bridge
set network.{{ net }}.proto=static set network.{{ net }}.proto=static
{%- set ports = ['eth1.' ~ pillar['vlans'][net]] %} {%- set ports = [wan_port ~ '.' ~ pillar['vlans'][net]] %}
{%- if conf.get('access-ports') == net %} {%- if conf.get('lan-access') == net %}
{%- do ports.append('eth0') %} {%- do ports.append(lan_port) %}
{%- endif %} {%- endif %}
set network.{{ net }}.ifname='{{ ' '.join(ports) }}' set network.{{ net }}.ifname='{{ ' '.join(ports) }}'
{%- endfor %} {%- endfor %}
{%- set radionum = 0 %} {%- set radionum = 0 %}
{%- set ifnum = 0 %}
{%- for path, radio in conf['radios'].items() %} {%- for path, radio in conf['radios'].items() %}
set wireless.radio{{ radionum }}=wifi-device set wireless.radio{{ radionum }}=wifi-device
set wireless.radio{{ radionum }}.type=mac80211 set wireless.radio{{ radionum }}.type=mac80211
@ -70,8 +98,8 @@ set wireless.radio{{ radionum }}.htmode={{ radio.get('htmode') or 'HT20' }}
set wireless.radio{{ radionum }}.noscan=1 set wireless.radio{{ radionum }}.noscan=1
delete wireless.radio{{ radionum }}.disabled delete wireless.radio{{ radionum }}.disabled
{%- set ifnum = 0 %}
{%- for ssid, ssidconf in radio['ssids'].items() %} {%- for ssid, ssidconf in radio['ssids'].items() %}
{%- set ifnum = ifnum + loop.index0 %}
set wireless.wifi{{ ifnum }}=wifi-iface set wireless.wifi{{ ifnum }}=wifi-iface
set wireless.wifi{{ ifnum }}.device=radio{{ radionum }} set wireless.wifi{{ ifnum }}.device=radio{{ radionum }}
set wireless.wifi{{ ifnum }}.ssid='{{ ssid }}' set wireless.wifi{{ ifnum }}.ssid='{{ ssid }}'
@ -84,9 +112,9 @@ set wireless.wifi{{ ifnum }}.key='{{ ssidconf['psk'] }}'
set wireless.wifi{{ ifnum }}.encryption=none set wireless.wifi{{ ifnum }}.encryption=none
{%- endif %} {%- endif %}
{%- set ifnum = ifnum + 1 %}
{%- endfor %} {%- endfor %}
{%- set ifnum = ifnum + radio['ssids'].items()|length %}
{%- set radionum = radionum + 1 %} {%- set radionum = radionum + 1 %}
{%- endfor %} {%- endfor %}