项目作者: PowerAruba

项目描述 :
PowerShell module to managed Aruba Instant AP
高级语言: PowerShell
项目地址: git://github.com/PowerAruba/PowerArubaIAP.git
创建时间: 2019-05-13T11:50:13Z
项目社区:https://github.com/PowerAruba/PowerArubaIAP

开源协议:Apache License 2.0

下载


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

  1. # Automated installation (Powershell 5 or later):
  2. Install-Module PowerArubaIAP
  3. # Import the module
  4. Import-Module PowerArubaIAP
  5. # Get commands in the module
  6. Get-Command -Module PowerArubaIAP
  7. # Get help
  8. 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 :

  1. # Connect to the Aruba Instant AP
  2. Connect-ArubaIAP 192.0.2.1
  3. #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)

  1. # Display clients (show clients)
  2. Get-ArubaIAPShowCmd "show clients"
  3. Status : Success
  4. Status-code : 0
  5. CLI Command executed : show clients
  6. IAP IP address : 10.44.55.230
  7. Command output : cli output:
  8. COMMAND=show clients
  9. Client List
  10. -----------
  11. Name IP Address MAC Address OS ESSID Access Point Channel Type Role IPv6 Address Signal Speed (mbps)
  12. ---- ---------- ----------- -- ----- ------------ ------- ---- ---- ------------ ------ ------------
  13. Number of Clients :0
  14. Info timestamp :1522412
  15. # Display SSID (Network) and output cli output (-display result)
  16. Get-ArubaIAPShowCmd "show network" -display_result
  17. cli output:
  18. COMMAND=show network
  19. Networks
  20. --------
  21. Profile Name ESSID Clients Type Band Authentication Method Key Management IP Assignment Status Zone Coding Active
  22. ------------ ----- ------- ---- ---- --------------------- -------------- ------------- ------ ---- ------ ------
  23. MPSK MPSK 0 employee all None WPA2-AES VLAN 44 Disabled - Default No
  24. WPA3 WPA3 0 employee all None WPA3_SAE Default VLAN Disabled - Default No
  25. [...]

Action

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

Hostname

  1. # Configure IAP (Host)Name
  2. Set-ArubaIAPHostname MyIAP

Radio State

  1. # For enable Radio (5Ghz and 2,4Ghz)
  2. Set-ArubaIAPRadioState -dot11a -dot11g
  3. # For disable Radio
  4. Set-ArubaIAPRadioState -dot11a:$false -dot11g:$false

Channel and Power

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

Swarm Mode

  1. # Use Standalone Mode
  2. Set-ArubaIAPSwarmmode Standalone
  3. # Use Cluster Mode (default)
  4. Set-ArubaIAPSwarmmode Cluster

Zone

  1. # Add IAP to a Zone
  2. Add-ArubaIAPZone MyZone
  3. # Remove all zone of IAP
  4. Remove-ArubaIAPZone

Configuration

AP Reboot

  1. # Restart All AP of the cluster
  2. Restart-ArubaIAPReboot -target all
  3. # Restart only AP with IP Address 192.0.2.1
  4. Restart-ArubaIAPReboot -iap_ip_addr 192.0.2.1 -target single

VC Country Code

  1. # Set Virtual Controller Country Code to FR
  2. Set-ArubaIAPCountryCode -country_code FR
  3. # Remove Virtual Controller Country code
  4. Remove-ArubaIAPCountryCode

VC IP Address

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

NTP Server

  1. # Set NTP Server to pool.ntp.org
  2. Set-ArubaIAPNTP -ntp pool.ntp.org
  3. # Remove NTP Server
  4. Remove-ArubaIAPNTP

System Location

  1. # Set System Location to PowerAruba
  2. Set-ArubaIAPSyslocation -syslocation PowerAruba
  3. # Remove System Location
  4. Remove-ArubaIAPSyslocation

Organization

  1. # Set Organization to MyOrg
  2. Set-ArubaIAPOrganization -syslocation MyOrg
  3. # Remove Organization
  4. Remove-Organization

Syslog Server

  1. # Set Syslog Server to 192.0.2.1
  2. Set-ArubaIAPSyslogServer 192.0.2.1
  3. # Remove Syslog Server
  4. Remove-ArubaIAPSyslogServer

Syslog Level

  1. # Set Syslog Level to debug (composant syslog)
  2. Set-ArubaIAPSyslogLevel -level debug
  3. #Set Syslog Level to error from composant network
  4. Set-ArubaIAPSyslogLevel -level error -composant network
  5. # Remove Syslog Level
  6. Remove-ArubaIAPSyslogLevel

Disconnecting

  1. # Disconnect from the Aruba Instant AP
  2. 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)

  1. IAP (config)# allow-rest-api
  2. IAP (config)# exit
  3. IAP# commit apply

List of available command

  1. Connect-ArubaIAP
  2. Disconnect-ArubaIAP
  3. Get-ArubaIAPShowCmd
  4. Invoke-ArubaIAPRestMethod
  5. Remove-ArubaIAPCountryCode
  6. Remove-ArubaIAPNTP
  7. Remove-ArubaIAPOrganization
  8. Remove-ArubaIAPSyslocation
  9. Remove-ArubaIAPSyslogLevel
  10. Remove-ArubaIAPSyslogServer
  11. Remove-ArubaIAPZone
  12. Restart-ArubaIAPReboot
  13. Set-ArubaIAPAntennaGain
  14. Set-ArubaIAPChannelPower
  15. Set-ArubaIAPCipherSSL
  16. Set-ArubaIAPConnection
  17. Set-ArubaIAPCountryCode
  18. Set-ArubaIAPHostname
  19. Set-ArubaIAPNTP
  20. Set-ArubaIAPOrganization
  21. Set-ArubaIAPRadioState
  22. Set-ArubaIAPSwarmMode
  23. Set-ArubaIAPSyslocation
  24. Set-ArubaIAPSyslogLevel
  25. Set-ArubaIAPSyslogServer
  26. Set-ArubaIAPuntrustedSSL
  27. Set-ArubaIAPVCIP
  28. Set-ArubaIAPZone
  29. Set-UseUnsafeHeaderParsing
  30. 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.