HP Procurve CLI Cheat
HP Procurve CLI Cheat
A list of basic commands for HP switches I find helpful. The commands are written for a
5400 running firmware K.15.13.0005, however, should be similar for any switch with a
recent firmware release.
Notes:
<> indicates a changeable variable, such as port number or VLAN ID.
[] indicates an optional string or value.
<Port> value can be either a single port (A1), multiple ports (A1,B3), or a port string (A1-
B10).
| signifies interchangeable (or) values.
9 Steps total
#copy config config1 usb <file name> --- Copy active config file to USB drive
#copy config config1 tftp <IP> <file name> --- Copy your config to file to TFTP server.
#copy tftp config <fileneme> <IP> ---Copy your config from TFTP server to switch
#copy tftp flash <IP> <file name> <primary|secondary> --- Download and update your
flash with from TFTP server
#copy flash usb <file name> <primary|secondary> --- Copy flash to USB drive
#copy flash tftp <IP> <file name> <primary|secondary> --- Copy flash to TFTP server
Step 3: Miscellaneous
#hostname <hostname> --- Set switch hostname
#link-test <destination switch MAC> --- Test connectivity between switches (local switch
and destination switch)
#chassislocate --- Turn on/off switch locator led or blink it (30 minutes)
#chassislocate blink <time> --- Blink switch locator led set time in minutes
#ntp1 <time server name> --- Add time server to NTP server list
Step 4: PoE
#show power-over-ethernet brief [<port>] --- To show PoE
#interface <port> lacp active --- Configure dynamic LACP trunk on c1-c4
#no interface <port> lacp --- Remove port from dynamic LACP (returns to passive
LACP)
#[no] int <port> rate-limit all <0...100> --- Set (or remove) rate limit on port according to
selected percentage
#show rate-limit all [<port>] --- Show rate limit on all or selected ports
#[no] int <port> rate-limit icmp <0...100> --- Set (or remove) rate limit to all ICMP traffic
#show rate-limit icmp [<port>] --- Show ICMP rate limit on all or selected ports
Step 6: Security
#port-security <port number> learn-mode configured address-limit 1 mac-address
<MAC address> --- Enable MAC address restriction and limit port access to one MAC
address.
#show mac <port> --- Show MAC-address of the device on specified port
#show mac <mac address> --- Show which port device with MAC-address is connected
to
#show rate-limit all [<port>] --- Show rate limit on all or selected ports
#show rate-limit icmp [<port>] --- Show ICMP rate limit on all or selected ports
Step 8: SNMPv3
#snmpv3 enable --- Enable SNMP version 3
#snmpv3 user <user name> --- Adds an SNMP user and creates an optional password
#snmpv3 group <group> user <user> sec-model ver3 --- Adds a user to a desired
access group
Step 9: VLANs
#vlan <vlan ID> name <vlan name> --- Create VLAN and set its ID and name
#vlan <vlan ID> <tagged|untagged> <port> --- Set port as tagged on vlan
#show vlan ports <port> --- Show VLAN ID and status of specific port
#show vlan <VLAN ID> --- Show ports on this VLAN and port status
#show vlan ports <port> --- Show VLAN ID and status of specific port
#Show Int d --- which give a real-time display of port traffic.
To show PoE
#show power-over-ethernet brief
Loop Detection
Turn on loop detection
#loop-protect 1-24
#loop-protect disable-timer 300
#show module -- Show installed modules with description and serial numbers