See below.

On Tuesday, February 21, 2017 at 9:40:48 AM UTC+1, mord reneth wrote:
>
> I'm setting the routers with a config to use 802.11r.....
>
 
Cool! I have never used 802.11r, I would be very interested to know about 
your progress on this task and I'm sure I'm not the only one.

So, there some common settings (ieee80211r, mobility_domain, pmk_r1_push) 
> which go in one common template.....and router specific settings (nasid, 
> r1_key_holder) which go in a seperate template for that router.
>
> Now, my question is: when setting these templates, which are object 
> properties under wireless access point, I have to enter radio and ssid 
> settings under both templates (and considering there is a third generic 
> template for wireless settings).....that's 3 templates with radio/ssid 
> settings. Thats 3 templates that HAVE to match....and any mistake will 
> cause a problem.
>
> Am I doing something wrong? Or is there a better way of doing it?
>

When using multiple templates, their order is important. Templates coming 
after override templates that come first (I just noticed I did not explain 
this properly in the netjsonconfig documentation 
<http://netjsonconfig.openwisp.org/>).

So you should put your general template first and the specific ones after.

The important thing is that all the interfaces have the same name ("wlan0") 
and the required attributes pass the schema validation.
Because some attributes are required (name, type, wireless mode, wireless 
radio, wireles ssid) you may need to duplicate some information in the 
different templates.
This duplication is not optimal and undesiderable, but easier to implement 
sanely at the moment, I'm sure that we'll find a better way of doing it in 
the near future.
 

> (FYI.....my 3 templates do match.....and the resulting configuration does 
> meet expectations)
>
 
Great.

You are doing things properly.

If I were you I would remove a few attributes that you don't use (I would 
also use the JSON boolean types instead of 1 or 0 because more readable), 
eg:

Template Roaming Setup:

{
    "interfaces": [
        {
            "name": "wlan0",
            "type": "wireless",
            "wireless": {
                "mode": "access_point",
                "radio": "radio0",
                "ssid": "testap",
                "ieee80211r": true,
                "mobility_domain": "e614",
                "pmk_r1_push": true
            }
        }
    ]
}


Template Router Specific Setup (MTU defaults to 1500 anyway so you can 
remove it):

{
    "interfaces": [
        {
            "name": "wlan0",
            "type": "wireless",
            "wireless": {
                "mode": "access_point",
                "radio": "radio0",
                "ssid": "testap",
                "nasid": "123456789012",
                "r1_key_holder": "123456789012"
            }
        }
    ]
}

But these are just small optimizations, you were doing it correctly already.

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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to