12 cursisten, JNCIA training, online vanuit onze eigen studio
Vraag: Meerdere malen per jaar wordt de Juniper MIST/JNCIA training verzorgd door Juniper Education Services. WiFi Wise voorziet in de gecertificeerd trainer, Juniper Education Services regelt de locatie (in Corona tijd veelel online vanuit onze eigen studio). Deze 4 daagse training wordt als zeer waardevol ervaren door de interactieve componenten. Kan de trainer voorzien in Engels talige trainingen voor cursisten van over de hele wereld?
Have you ever watched a magician perform a magic trick and wondered how he did it?
Today I’m going to reveil the magic that Packet Magician Peter MacKenzie is using to block his kids internet.
If you’ve been in Peter’s JNCIS MistAI class you’ve probably seen him say “hey Siri, Block Luke’s internet” with an evil grin on his face. If not, Jussi Kiviniemi got a screenshot of it on twitter.
Did you get an Mist AP on one of the Wireless Wednesdays and want to get your kids to the dinner table? Or do you just want to show off to your boss by enabling the guest network by a voice command? Then keep reading.
Getting the right code
Everything that we do in the Mist UI is translated into API calls. So first off we need to get the right API call. I’m going to use the block internet example here, but you can to the same with enabling or disabling an SSID.
As we are using a WxLAN policy that blocks access for a client we need to build that rule first.
It is made of 3 components, a group of clients, an action (block) and a resource.
First off I created a label under Network -> Labels.
Here I grouped the mac addresses for my kids devices
Next I needed to build the policy, again on the site level so under Network -> Policy I created a policy using the label Kids and blocking them access to All resources. I’ve saved the rule and then DISABLED it. In the end I’ve created 3, each one of my boys individually, and them all combined.
Now this is where the magic happens, now I need to build or steal the API call needed to to enable the rule I want. Building is quite hard but there is loads of documentation found here and here.
So I’m going to show you how to steal the API call. For that the I’m going to open the Mist UI using Google Chrome.
Under the Menu -> More Tools you can find Developer Tools.
With these Developer Tools we can see everything our browser is doing on a webpage. This can be a lot so I’ve added a filter to just show me things to api.mist.com
So now when I enable the policy and press save I can see the actual API calls made:
You can see the PUT method as we are changing a value not a POST and creating a new entry. And in the body we see the “Enabled” set to “True”
The API call and the Enabled : True is what we need for our plan. The only other thing we need is API access. We need an API token.