Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

555 Commits

Repository files navigation

PowerArubaSW

This is a Powershell module for configure a ArubaOS Switch.

With this module (version 1.0.0) you can manage:

  • System (Name, Location, Contact) & Switch Status (Product and Hardware info)
  • Vlans (Add/Configure/Remove)
  • Vlans Ports (Add/Configure/Remove a vlan (tagged/untagged/forbidden) to a interface)
  • REST (Get API Version / Get|Set Rest Timeout)
  • LLDP (Get|Set GlobalStatus, Get ports/neighbor stats, Get Remote)
  • LACP (Add/Configure/Remove)
  • Led Locator (Get|Set Led indicator)
  • Ports (Information (name, status, config_mode...) and Statistics)
  • DNS (Add/configure/remove IP Address and domain names)
  • Trunk (Add/Configure/Remove)
  • STP (Add/Configure/Remove GlobalConfig or Port)
  • IP Address (Get)
  • Cli (AnyCli and CliBatch for send CLI function)
  • PoE (Get/Configure PoE Settings and Get Poe Stats)
  • RADIUS Server (Add/Get/Set/Remove)
  • RADIUS Group (Add/Get/Remove)
  • RADIUS Profile (Get/Set)
  • MAC Table (Get)
  • Banner (Get/set)
  • Ping (Test)
  • Multi Connection
  • Multi Version

More functionality will be added later.

Connection can use HTTPS (default) or HTTP Tested with Aruba OS 2530, 2930F, 2930M, 3810, 54xxRzl (using 16.05.x firmware and later...) on Windows/Linux/macOS

Usage

All resource management functions are available with the Powershell verbs GET, ADD, SET, REMOVE. For example, you can manage Vlans with the following commands:

  • Get-ArubaSWVlans
  • Add-ArubaSWVlans
  • Set-ArubaSWVlans
  • Remove-ArubaSWVlans

Requirements

  • Powershell 5 or 6 (Core) (If possible get the latest version)
  • An Aruba OS Switch (with firmware 16.x), REST API enable and HTTPS enable (recommended)

Instructions

Install the module

# Automated installation (Powershell 5 or later):Install-Module PowerArubaSW
# Import the moduleImport-Module PowerArubaSW
# Get commands in the moduleGet-Command-Module PowerArubaSW
# Get helpGet-HelpGet-ArubaSWVlans-Full

Examples

Connecting to the Aruba Switch

The first thing to do is to connect to a Aruba Switch with the command Connect-ArubaSW :

# Connect to the Aruba SwitchConnect-ArubaSW192.0.2.1#we get a prompt for credential

if you get a warning about Unable to connect Look Issue

Vlans Management

You can create a new Vlan Add-ArubaSWVlans, retrieve its information Get-ArubaSWVlans, modify its properties Set-ArubaSWVLans, or delete it Remove-ArubaSWVlans.

# Create a vlanAdd-ArubaSWVlans-id 85-Name 'PowerArubaSW'-is_voice_enabled
uri : /vlans/85
vlan_id : 85
name : PowerArubaSW
status : VS_PORT_BASED
type : VT_STATIC
is_voice_enabled : True
is_jumbo_enabled : False
is_dsnoop_enabled : False
# Get information about vlanGet-ArubaSWVlans-name PowerArubaSW | ft
uri vlan_id name status type is_voice_enabled is_jumbo_enabled is_dsnoop_enabled is_management_vlan
-------------------------------------------------------------------------------------------/vlans/8585 PowerArubaSW VS_PORT_BASED VT_STATIC True False False False
# Remove a vlanRemove-ArubaSWVlans-id 85

Disconnecting

# Disconnect from the ArubaOS SwitchDisconnect-ArubaSW

Issue

Unable to connect (certificate)

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

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

Unable to connect

if you use Connect-ArubaSW and get Unable to Connect

Check if the HTTPS is enable on the switch

PowerArubaSW# show web-management
Web Management - Server Configuration
HTTP Access : Enabled
HTTPS Access : Enabled
SSL Port : 443
Idle Timeout : 600 seconds
Management URL : http://h17007.www1.hpe.com/device_help
Support URL : http://www.arubanetworks.com/products/networking/
User Interface : Improved

if it is not enabled you can enable using

(config)# crypto pki enroll-self-signed certificate-name PowerArubaSW subject common-name PowerArubaSW country FR locality PowerArubaSW org PowerArubaSW org-unit PowerArubaSW
(config)# web-management ssl

You can use also Connect-ArubaSW -httpOnly for connect using HTTP (NOT RECOMMENDED !)

MultiConnection

From release 0.8.0, it is possible to connect on same times to multi switch You need to use -connection parameter to cmdlet

For example to get Vlan Ports of 2 switchs

# Connect to first switch$sw1=Connect-ArubaSW192.0.2.1-SkipCertificateCheck -DefaultConnection:$false#DefaultConnection set to false is not mandatory but only don't set the connection info on global variable# Connect to second switch$sw2=Connect-ArubaSW192.0.2.1-SkipCertificateCheck -DefaultConnection:$false# Get Vlan Ports for first switchGet-ArubaSWVlanPorts-connection $sw1
uri vlan_id port_id port_mode
--------------------------/vlans-ports/1-1/111/1 POM_UNTAGGED
/vlans-ports/23-1/2231/2 POM_UNTAGGED
/vlans-ports/1-1/311/3 POM_UNTAGGED
/vlans-ports/23-1/3231/3 POM_TAGGED_STATIC
....
# Get Vlan Ports for second switchGet-ArubaSWVlanPorts-connection $sw2
uri vlan_id port_id port_mode
--------------------------/vlans-ports/1-1/111/1 POM_UNTAGGED
/vlans-ports/23-1/1231/1 POM_TAGGED_STATIC
/vlans-ports/1-1/211/2 POM_UNTAGGED
/vlans-ports/23-1/3231/3 POM_UNTAGGED
...
#Each cmdlet can use -connection parameter

MultiVersion

From release 1.0.0, it is possible to select API Version

For example to connect using API v2 (for some very old device) by default using v3 API and use last available (v8) release for other call

# Connect using API versionConnect-ArubaSW192.0.2.1-SkipCertificateCheck -api_version 2#to change the api version, you can use, the other API call will be use API v8#You can also use -api_version with Invoke-ArubaSWWebRequest

List of available command

Add-ArubaSWLACPAdd-ArubaSWRadiusServerAdd-ArubaSWRadiusServerGroupAdd-ArubaSWTrunkAdd-ArubaSWVlansAdd-ArubaSWVlansPortsConnect-ArubaSWDisconnect-ArubaSWGet-ArubaSWBannerGet-ArubaSWCliGet-ArubaSWCliBatchStatusGet-ArubaSWDnsGet-ArubaSWIpAddressGet-ArubaSWLACPGet-ArubaSWLedGet-ArubaSWLLDPGlobalStatusGet-ArubaSWLLDPNeighborStatsGet-ArubaSWLLDPPortStatsGet-ArubaSWLLDPRemoteGet-ArubaSWMacTableGet-ArubaSWModulesGet-ArubaSWPoEGet-ArubaSWPoEStatsGet-ArubaSWPortGet-ArubaSWPortStatisticsGet-ArubaSWRadiusProfileGet-ArubaSWRadiusServerGet-ArubaSWRadiusServerGroupGet-ArubaSWRestSessionTimeoutGet-ArubaSWRestVersionGet-ArubaSWSTPGet-ArubaSWSTPPortGet-ArubaSWSystemGet-ArubaSWSystemStatusGet-ArubaSWSystemStatusGlobalGet-ArubaSWSystemStatusSwitchGet-ArubaSWTrunkGet-ArubaSWVlansGet-ArubaSWVlansPortsInvoke-ArubaSWWebRequestRemove-ArubaSWDnsRemove-ArubaSWLACPRemove-ArubaSWRadiusServerRemove-ArubaSWRadiusServerGroupRemove-ArubaSWTrunkRemove-ArubaSWVlansRemove-ArubaSWVlansPortsSend-ArubaSWCliBatchSet-ArubaSWBannerSet-ArubaSWCipherSSLSet-ArubaSWConnectionSet-ArubaSWDnsSet-ArubaSWLedSet-ArubaSWLLDPGlobalStatusSet-ArubaSWPoESet-ArubaSWPortSet-ArubaSWRadiusProfileSet-ArubaSWRadiusServerSet-ArubaSWRestSessionTimeoutSet-ArubaSWSTPSet-ArubaSWSTPPortSet-ArubaSWSystemSet-ArubaSWuntrustedSSLSet-ArubaSWVlansSet-ArubaSWVlansPortsSet-CookieShow-ArubaSWExceptionTest-ArubaSWPing

Author

Alexis La Goutte

Special Thanks

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

License

Copyright 2018-2021 Alexis La Goutte and the community.

About

PowerShell module to manage ArubaOS switches

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages