Use Bind to Source to dynamically change configuration on WLAN profiles

The problem

When making SSIDs for your SDA wireless deployment, a profile is made in DNA-C, as of 1.3.3.9 I have no options to differentiate between different ISE deployments. In my case, I needed to use a different ISE for my Guest, Scanner, and Mobile SSID and I needed to push this to several WLC’s.

So, I thought it would be pretty easy to target the specific profile name and change it with a very basic template – but I was wrong.

Have a look at the name that DNA-Center provisions the WLC with:

wlan RDA_Gue_Global_F_716a4e61 18 RDA_Guest

The profile name and WLAN ID are not always the same on different WLC’s, so a simple template that calls the same profile name and WLAN ID is out of the question.

The solution

But then I thought – the DNA-Center has all this information somewhere for sure, and it knows about the different configurations, so I must be able to use that in my template.

But the question is how?

This is where Bind to Source comes into the picture. You can define a variable in the template editor and bind it to a source. The DNA-Center has a bunch of categories you can choose from in a drop-down list:

Bind to Source drop down

Each of these has a drop-down list of entities, and they all have a list of attributes:

Bind to source attributes

This is how I set up my variable:

Bind to source variable

Notice that I did not select anything in the attribute. This just means that I will get all the attributes that the entity contains. So, in this case I will receive: profileName and wlanId.

Keep in mind as well, that this step is something you do after you have created your template. I have documented this in the following order to better explain the concept.

But an early warning: I am not a software developer, so it is very possible that this could have been done in a smarter way. But this is the template I used, and it worked out for me.

Template

#foreach ($profile in ${wlan})                          ! $wlan is the variable that I bind to a source, I put that information into my for loop in a variable called $profile !

  #if ($profile.profileName.contains("Gue_"))           ! If the profile name contains Gue_ it will then proceed with the next underlying steps !

    #set ($Profile_name = $profile.profileName)         ! I create a variable called $Profile_name that takes the attribute profileName that is returned by the bind to source we did !

    #set ($Profile_ID = $profile.wlanId)                ! I create a variable called $Profile_ID that takes the attribute wlanId that is returned by the bind to source we did !

    wlan ${Profile_name} ${Profile_ID} RDA_Guest        ! Now I use the $Profile_name and $Profile_ID to access the right profile and configure it on the next three lines. The rest is just repetition of this section !

    shutdown

    mac-filtering Guest-Portal

    no shutdown

  #elseif ($profile.profileName.contains("Mob_"))

    #set ($Profile_name = $profile.profileName)

    #set ($Profile_ID = $profile.wlanId)

    wlan ${Profile_name} ${Profile_ID} RDA_Mobile

    shutdown

    mac-filtering Legacy

    no shutdown

  #elseif ($profile.profileName.contains("Sca_"))

    #set ($Profile_name = $profile.profileName)

    #set ($Profile_ID = $profile.wlanId)

    wlan ${Profile_name} ${Profile_ID} RDA_Scanner

    shutdown

    mac-filtering Legacy

    no shutdown

  #end

#end

Note: the indentation is just for making this easier to read, it has no effect on the code.

Next step is to attach this profile, so that it can be used in provisioning on your device, but I am not going to cover this here.

Provision your device and result should be a success!