Git Product home page Git Product logo

powerarubaiap's Introduction

PowerArubaIAP

This is a Powershell module for configure a Aruba Instant AP (IAP)

With this module (version 0.3.0) you can manage:

  • Show commands
  • Action API
  • Configuration API (Partially)

More functionality will be added later.

Connection can use HTTPS (default) Tested with Aruba Instant AP 207 or AP305 (using 8.5.x.x firmware and later...) on Windows/Linux/macOS

Requirements

  • Powershell 5 or 6 (Core) (If possible get the latest version)
  • An Aruba Instant AP (with firmware 8.5.x.x), REST API enable

Instructions

Install the module

# Automated installation (Powershell 5 or later):
    Install-Module PowerArubaIAP

# Import the module
    Import-Module PowerArubaIAP

# Get commands in the module
    Get-Command -Module PowerArubaIAP

# Get help
    Get-Help Get-ArubaIAPShowCmd -Full

Examples

Connecting to the Aruba Instant AP

The first thing to do is to connect to a Aruba Instant AP with the command Connect-ArubaIAP :

# Connect to the Aruba Instant AP
    Connect-ArubaIAP 192.0.2.1

#we get a prompt for credential

if you get a warning about Unable to connect Look Issue

Monitoring

Show command

You can display some command... (CLi to API)

# Display clients (show clients)
    Get-ArubaIAPShowCmd "show clients"


    Status               : Success
    Status-code          : 0
    CLI Command executed : show clients

    IAP IP address       : 10.44.55.230
    Command output       : cli output:

                        COMMAND=show clients

                        Client List
                        -----------
                        Name  IP Address  MAC Address  OS  ESSID  Access Point  Channel  Type  Role  IPv6 Address  Signal  Speed (mbps)
                        ----  ----------  -----------  --  -----  ------------  -------  ----  ----  ------------  ------  ------------
                        Number of Clients   :0
                        Info timestamp      :1522412



# Display SSID (Network) and output cli output (-display result)
    Get-ArubaIAPShowCmd "show network" -display_result
    cli output:

    COMMAND=show network

    Networks
    --------
    Profile Name  ESSID      Clients  Type      Band  Authentication Method  Key Management  IP Assignment  Status    Zone  Coding   Active
    ------------  -----      -------  ----      ----  ---------------------  --------------  -------------  ------    ----  ------   ------
    MPSK          MPSK       0        employee  all   None                   WPA2-AES        VLAN 44        Disabled  -     Default  No
    WPA3          WPA3       0        employee  all   None                   WPA3_SAE        Default VLAN   Disabled  -     Default  No
[...]

Action

For each action, you can use -iap_ip_addr for configure an IAP of cluster (using IP Address)

Hostname

# Configure IAP (Host)Name
    Set-ArubaIAPHostname MyIAP

Radio State

# For enable Radio (5Ghz and 2,4Ghz)
    Set-ArubaIAPRadioState -dot11a -dot11g

# For disable Radio
    Set-ArubaIAPRadioState -dot11a:$false -dot11g:$false

Channel and Power

# for configure manually channel and Power for 802.11a (5Ghz) and 802.11g (2,4Ghz)
    Set-ArubaIAPChannelPower -apower 10 -achannel 36 -gpower 15 -g-channel 1

Swarm Mode

# Use Standalone Mode
    Set-ArubaIAPSwarmmode Standalone

# Use Cluster Mode (default)
    Set-ArubaIAPSwarmmode Cluster

Zone

# Add IAP to a Zone
    Add-ArubaIAPZone MyZone

# Remove all zone of IAP
    Remove-ArubaIAPZone

Configuration

AP Reboot

# Restart All AP of the cluster
    Restart-ArubaIAPReboot -target all

# Restart only AP with IP Address 192.0.2.1
   Restart-ArubaIAPReboot -iap_ip_addr 192.0.2.1 -target single

VC Country Code

# Set Virtual Controller Country Code to FR
    Set-ArubaIAPCountryCode -country_code FR

# Remove Virtual Controller Country code
    Remove-ArubaIAPCountryCode

VC IP Address

# Set Virtual Controller IP(v4) Address to 192.0.2.1
    Set-ArubaIAPVCIP -vc_ip 192.0.2.1

NTP Server

# Set NTP Server to pool.ntp.org
    Set-ArubaIAPNTP -ntp pool.ntp.org

# Remove NTP Server
    Remove-ArubaIAPNTP

System Location

# Set System Location to PowerAruba
    Set-ArubaIAPSyslocation -syslocation PowerAruba

# Remove System Location
    Remove-ArubaIAPSyslocation

Organization

# Set Organization to MyOrg
    Set-ArubaIAPOrganization -syslocation MyOrg

# Remove Organization
    Remove-Organization

Syslog Server

# Set Syslog Server to 192.0.2.1
    Set-ArubaIAPSyslogServer 192.0.2.1

# Remove Syslog Server
    Remove-ArubaIAPSyslogServer

Syslog Level

# Set Syslog Level to debug (composant syslog)
    Set-ArubaIAPSyslogLevel -level debug

#Set Syslog Level to error from composant network
    Set-ArubaIAPSyslogLevel -level error -composant network

# Remove Syslog Level
    Remove-ArubaIAPSyslogLevel

Disconnecting

# Disconnect from the Aruba Instant AP
    Disconnect-IAP

Issue

Unable to connect (certificate)

if you use Connect-ArubaIAP and get Unable to Connect (certificate)

The issue coming from use Self-Signed or Expired Certificate for AP management Try to connect using Connect-ArubaIAP -SkipCertificateCheck

REST API Service is not enabled

if you use Connect-ArubaIAP and get 503 Service Unavailable REST API Service is not enabled

You need to enable REST APi via CLI (SSH)

IAP (config)# allow-rest-api
IAP (config)# exit
IAP# commit apply

List of available command

Connect-ArubaIAP
Disconnect-ArubaIAP
Get-ArubaIAPShowCmd
Invoke-ArubaIAPRestMethod
Remove-ArubaIAPCountryCode
Remove-ArubaIAPNTP
Remove-ArubaIAPOrganization
Remove-ArubaIAPSyslocation
Remove-ArubaIAPSyslogLevel
Remove-ArubaIAPSyslogServer
Remove-ArubaIAPZone
Restart-ArubaIAPReboot
Set-ArubaIAPAntennaGain
Set-ArubaIAPChannelPower
Set-ArubaIAPCipherSSL
Set-ArubaIAPConnection
Set-ArubaIAPCountryCode
Set-ArubaIAPHostname
Set-ArubaIAPNTP
Set-ArubaIAPOrganization
Set-ArubaIAPRadioState
Set-ArubaIAPSwarmMode
Set-ArubaIAPSyslocation
Set-ArubaIAPSyslogLevel
Set-ArubaIAPSyslogServer
Set-ArubaIAPuntrustedSSL
Set-ArubaIAPVCIP
Set-ArubaIAPZone
Set-UseUnsafeHeaderParsing
Show-ArubaIAPException

Author

Alexis La Goutte

Special Thanks

  • Warren F. for his blog post 'Building a Powershell module'
  • Erwan Quelin for help about Powershell

License

Copyright 2019 Alexis La Goutte and the community.

powerarubaiap's People

Contributors

alagoutte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

alagoutte

powerarubaiap's Issues

Add Configuration API

From Aruba Instant 8.5 REST API Guide, Add Configuration API

  • VC Country Code
  • VC IP address
  • NTP Server
  • Syslocation
  • Organization
  • Syslog Level
  • Syslog Server
  • dot11g Radio Profile
  • ARM
  • dot11a Radio Profile
  • SSID Profile
  • RF Band
  • Authentication Server Profile
  • ACL Profile
  • External Captive Portal
  • IDS
  • Software Upgrade
  • Time Zone
  • AP Reboot
  • Wired Port Profile
  • Wired Profile Map
  • Management User

Add Action API

From Aruba Instant 8.5, Add Action API

  • Hostname
  • Swarm Mode
  • Static Channel and Power
  • Zone
  • Antenna gain
  • Enabling and disabling radios

HttpWebRequestError: The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF

When trying to connect to an IAP AP-303 with OS 8.5 I get an error message:

HttpWebRequestError: The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF

I added a function to enable parsing of unsafe headers to conection.ps1 and it solved the problem.

function Set-UseUnsafeHeaderParsing
        {
            param(
                [Parameter(Mandatory,ParameterSetName='Enable')]
                [switch]$Enable,

                [Parameter(Mandatory,ParameterSetName='Disable')]
                [switch]$Disable
            )

            $ShouldEnable = $PSCmdlet.ParameterSetName -eq 'Enable'

            $netAssembly = [Reflection.Assembly]::GetAssembly([System.Net.Configuration.SettingsSection])

            if($netAssembly)
            {
                $bindingFlags = [Reflection.BindingFlags] 'Static,GetProperty,NonPublic'
                $settingsType = $netAssembly.GetType('System.Net.Configuration.SettingsSectionInternal')

                $instance = $settingsType.InvokeMember('Section', $bindingFlags, $null, $null, @())

                if($instance)
                {
                    $bindingFlags = 'NonPublic','Instance'
                    $useUnsafeHeaderParsingField = $settingsType.GetField('useUnsafeHeaderParsing', $bindingFlags)

                    if($useUnsafeHeaderParsingField)
                    {
                    $useUnsafeHeaderParsingField.SetValue($instance, $ShouldEnable)
                    }
                }
            }
        }

        Set-UseUnsafeHeaderParsing -Enable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.