Wireless interface template

592 views
Skip to first unread message

leoni...@gmail.com

unread,
May 16, 2021, 3:33:15 AM5/16/21
to open...@googlegroups.com

I state that I have recently approached Openwrt. I noticed that just installed, by default Openwrt has a virtual interface called LAN that relies on a bridge called br-lan between the eth0 physical ethernet interface and the wlan0 wireless interface.

This wireless interface called wlan0 has in the Network field the virtual interface called LAN mentioned above and is associated with the object radio0.

I would like to leave the default configuration, but only change the wlan0 wireless interface settings.

To do this from Openwisp, I created an Interface type template with the following fields:

 

Interface1: Wireless Interface

name: wlan0

type: wireless

autostart: yes

network: LAN

wireless: access point

mode: access point

radio: radio0

 

When I go to the AP, I find that another virtual interface called LAN has been created, basically a duplicate. In addition, the wlan0 wireless interface appears to be in WDS.

 

Why? Thank you

Federico Capoano

unread,
May 17, 2021, 11:46:42 AM5/17/21
to open...@googlegroups.com
Hi,

Can you share the NetJSON configuration of this interface please?

Federico

--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/078701d74a25%24b9e24c60%242da6e520%24%40gmail.com.

leoni...@gmail.com

unread,
May 18, 2021, 12:59:48 PM5/18/21
to open...@googlegroups.com

{

    "interfaces": [

        {

            "wireless": {

                "network": [],

                "mode": "access_point",

                "radio": "radio0",

                "ack_distance": 0,

                "rts_threshold": 0,

                "frag_threshold": 0,

                "ssid": "Righi_Wifi",

                "hidden": false,

                "wds": false,

                "encryption": {

                    "protocol": "wpa2_personal",

                    "key": "WifiRgh-935@?x0",

                    "disabled": false,

                    "cipher": "auto"

                },

                "wmm": true,

                "isolate": false,

                "macfilter": "disable",

                "maclist": []

            },

           "type": "wireless",

            "name": "wlan0",

            "mtu": 1500,

            "mac": "",

            "autostart": true,

            "disabled": false,

            "addresses": [],

            "network": "LAN"

        }

    ]

}

 

Bye

 

Da: open...@googlegroups.com <open...@googlegroups.com> Per conto di Federico Capoano
Inviato: lunedì 17 maggio 2021 17:46
A: open...@googlegroups.com
Oggetto: Re: [openwisp] Wireless interface template

Federico Capoano

unread,
May 18, 2021, 1:11:28 PM5/18/21
to open...@googlegroups.com
Please see the concept of "attached network":
http://netjsonconfig.openwisp.org/en/latest/backends/openwrt.html#wireless-attached-to-a-different-network

This is the conf you should be using:

{
    "interfaces": [
        {
            "wireless": {
                "network": ["lan"],
    ]
}


Best regards
Federico Capoano

leoni...@gmail.com

unread,
May 20, 2021, 11:37:59 AM5/20/21
to open...@googlegroups.com

Hi, I followed the given configuration but I had the following problems:

in Network \ Interface there is a virtual interface called WLAN0 for which there is the error: "Error: Network device is not present".

In Network \ Wireless the wlan0 interface which in Mode is set as Access Point (WDS) must be set as Access Point. How can I solve?

Thank you

 

 

Da: open...@googlegroups.com <open...@googlegroups.com> Per conto di Federico Capoano

Inviato: martedì 18 maggio 2021 19:11

Federico Capoano

unread,
May 22, 2021, 11:53:58 AM5/22/21
to open...@googlegroups.com
I have no way to verify what you're saying.

I suggest you to proceed as follows: forget for a moment OpenWISP and focus on finding out the right OpenWRT configuration that works for the use case you need.
Once you have that, generate the same configuration via OpenWISP (check the generated configuration using preview).

What you say about WDS does not make sense because WDS is set to disabled explicitly, so there's likely an issue somewhere else.

Best regards
Federico Capoano

AndyX90

unread,
Aug 30, 2021, 9:13:03 AM8/30/21
to OpenWISP
@f.copano:
I am experiencing the same problem...
I have also followed the docs-section (http://netjsonconfig.openwisp.org/en/latest/backends/openwrt.html#wireless-attached-to-a-different-network) but this ends up in an orphaned interface.
The wifi is then assigned to the bridge and an interface consisting only of that wifi.
I have also tried configuring openwrt via luci and open it via netjsonconfig OpenWrt(native=open... but this gives errors like "...is not valid under any of the given schemas"
Is there any solution for this?

Federico Capoano

unread,
Aug 30, 2021, 11:55:30 AM8/30/21
to open...@googlegroups.com
Dear AndyX90,

anything can be solved, if the steps to replicate the issue are described in detail, we may be able to help out. 

Best regards
Federico Capoano

AndyX90

unread,
Aug 30, 2021, 3:23:38 PM8/30/21
to OpenWISP
Thank You Sir!

Okay, my AccessPoints are D-Link DAP-2610 with one single Port.
I am trying to accomplish the following:
They should have their only IP-Address on the default Lan-Bridge.
They should bridge multiple WiFi-SSIDs to different tagged vlans without having an interface in that vlan (proto none).
The wireless authentication takes place via radius through their "Management-Interface" on br-lan.

If i configure it via luci, it looks like the following:

network:

    config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

    config globals 'globals'
        option ula_prefix 'fd31:5721:4264::/48'

    config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

    config device
        option name 'eth0'
        option macaddr 'xx:xx:xx:xx:xx:xx'

    config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

    config device
        option type '8021q'
        option ifname 'eth0'
        option vid '13'
        option name 'eth0.13'

    config device
        option type 'bridge'
        option name 'WIFIBRIDGE'
        list ports 'eth0.13'

    config bridge-vlan
        option device 'WIFIBRIDGE'
        option vlan '1'
        list ports 'eth0.13:t'

    config interface 'WIFIBRIDGE'
        option proto 'none'
        option device 'WIFIBRIDGE'

wireless:


    config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/soc/a000000.wifi'
        option band '2g'
        option htmode 'HT20'
        option cell_density '0'
        option country 'DE'
        option channel 'auto'

    config wifi-device 'radio1'
        option type 'mac80211'
        option path 'platform/soc/a800000.wifi'
        option band '5g'
        option htmode 'VHT80'
        option cell_density '0'
        option channel 'auto'
        option country 'DE'

    config wifi-iface 'wifinet0'
        option device 'radio0'
        option mode 'ap'
        option ssid 'MyRadiusWIFI'
        option encryption 'wpa2+ccmp'
        option auth_server '10.10.10.10'
        option auth_port '1812'
        option auth_secret 'MYSECRET'
        option acct_server '10.10.10.10'
        option acct_port '1813'
        option acct_secret 'MYSECRET'
        option ieee80211r '1'
        option nasid 'MyRadiusWIFI-2.4G'
        option ft_over_ds '1'
        option ft_psk_generate_local '1'
        option network 'WIFIBRIDGE'

    config wifi-iface 'wifinet1'
        option device 'radio1'
        option mode 'ap'
        option ssid 'MyRadiusWIFI'
        option encryption 'wpa2+ccmp'
        option auth_server '10.10.10.10'
        option auth_port '1812'
        option auth_secret 'MYSECRET'
        option acct_server '10.10.10.10'
        option acct_port '1813'
        option acct_secret 'MYSECRET'
        option ieee80211r '1'
        option nasid 'MyRadiusWIFI-5G'
        option ft_over_ds '1'
        option ft_psk_generate_local '1'
        option network 'WIFIBRIDGE'

OpenWISP generates the following config:

    package network

    config interface 'WIFIBRIDGE'
        option auto '1'
        option enabled '1'
        option ifname 'eth0.13'
        option igmp_snooping '1'
        option mtu '1500'
        option proto 'none'
        option stp '0'
        option type 'bridge'

    config interface 'wlan0'
        option auto '1'
        option enabled '1'
        option ifname 'wlan0'
        option mtu '1500'
        option proto 'none'

    config interface 'wlan1'
        option auto '1'
        option enabled '1'
        option ifname 'wlan1'
        option mtu '1500'
        option proto 'none'

    package wireless

    config wifi-iface 'wifi_wlan0'
        option acct_secret 'MYSECRET'
        option acct_server '10.10.10.10'
        option acct_server_port '1813'
        option auth_port '1812'
        option auth_secret 'MYSECRET'
        option auth_server '10.10.10.10'
        option device 'radio0'
        option disabled '0'
        option encryption 'wpa2+ccmp'
        option hidden '0'
        option ifname 'wlan0'
        option isolate '0'
        option key 'MYSECRET'
        option macfilter 'disable'
        option mode 'ap'
        option nasid '{{name}}-2.4G'
        option network 'WIFIBRIDGE'
        option port '1812'
        option server '10.10.10.10'
        option ssid 'MyRadiusWIFI'
        option wds '0'
        option wmm '1'

    config wifi-iface 'wifi_wlan1'
        option acct_secret 'MYSECRET'
        option acct_server '10.10.10.10'
        option acct_server_port '1813'
        option auth_port '1812'
        option auth_secret 'MYSECRET'
        option auth_server '10.10.10.10'
        option device 'radio1'
        option disabled '0'
        option encryption 'wpa2+ccmp'
        option hidden '0'
        option ifname 'wlan1'
        option isolate '0'
        option key 'MYSECRET'
        option macfilter 'disable'
        option mode 'ap'
        option nasid '{{name}}-5G'
        option network 'WIFIBRIDGE'
        option port '1812'
        option server '10.10.10.10'
        option ssid 'MyRadiusWIFI'
        option wds '0'
        option wmm '1'
        
But there are the two "orphaned" Interfaces on top.
Note that luci generates switch-configs according to the new DSA-Style (https://openwrt.org/docs/guide-user/network/vlan/switch).

Also as i stated above, i tried to import a configuration from luci with netjsonconfig OpenWrt(native=open... but it errors that none of the schemas are matching...

Do you have any Ideas?

Thank You very much!

Federico Capoano

unread,
Sep 29, 2021, 10:53:23 AM9/29/21
to OpenWISP
Hi there,

sorry for my late response, I forgot to reply to your questions.

OpenWrt 21 has changed the configuration format quite a bit, OpenWISP does not support this new format yet (DSA, new bridge syntax, "config device").
Since OpenWrt still supports to the old format, we have to stick to that one once the configuration engine of OpenWISP is upgraded.

If you don't know how to use the old format, I am afraid I can't help right now.

Best luck
Federico

Reply all
Reply to author
Forward
0 new messages