Configure HP Procurve Switch via Command Line Interface

After getting my eyes of a Cisco 2960 configured created by DEECD, I decided to replicate their config on our HP Procurve switches.

Connect to the switch via telnet or the serial console and enter config mode

switch# config

Set IP address gateway

ip default-gateway 10.136.236.1

Set hostname and contact details

switch(config)# hostname "2510_01"
2510_01(config)# snmp-server contact "tyrone.wyatt@gmail.com"
2510_01(config)# snmp-server location "Senior Campus, Server Room"

Set timezone and network time protocol details

2510_01(config)# timesync sntp
2510_01(config)# sntp server 10.10.20.69
2510_01(config)# sntp unicast

Set timezone offset from GMT in minutes

2510_01(config)# time timezone 600

Enable web management SSL and disable web management plaintext

2510_01(config)# crypto key generate cert 1024
2510_01(config)# crypto host-cert generate self-signed
Validity start date [10/21/2012]: 10/21/2012
Validity end date [10/21/2013]: 10/21/2018
Common name [0.0.0.0]: 10.136.236.68
Organizational unit [Dept Name]: ICT
Organization [Company Name]: XXXX College
City or location [City]: XXXX
State name [State]: VIC
Country code [US]: AU
2510_01(config)# web-management ssl
2510_01(config)# no web-management plaintext

Enable SSH and disable telnet

2510_01(config)# crypto key generate ssh
Installing new RSA key. If the key/entropy cache is depleted, this could take up to a minute.

Enable SSH version 2 if supported

2510_01(config)# ip ssh version 2

Enable SSH version 1 if version 2 isn’t supported

2510_01(config)# ip ssh
2510_01(config)# no telnet-server

Set username and passwords

2510_01(config)# password manager user-name admin
2510_01(config)# password operator user-name monitor

Set banner

2510_01(config)# banner motd %
#######################################################################
# Authorised Users Only #
# The information on this computer and network is the property of #
# <COMPANY NAME> and is protected by intellectual property #
# rights. You must be assigned an account on this computer to #
# access the information and are only allowed to access information as #
# defined by the System Administrator(s). Your activities are #
# monitored for security reasons. #
########################################################################
%

Set name for interface/s

interface B1-B6 name " "

Save and view the configuration

2510_01(config)# write memory
2510_01(config)# show run

References

http://h20000.www2.hp.com/bc/docs/support/SupportManual/c01868095/c01868095.pdf
http://www.rienbroekstra.nl/?q=node/18
http://linuxman.wikispaces.com/HP+ProCurve+E-series+setup

8 thoughts on “Configure HP Procurve Switch via Command Line Interface

  1. If web management SSL is problematic add the following in place of the above when generating the key

    crypto key generate cert rsa bits 1024

  2. i want to connect one cisco switch with HP procurve on port 48. anybody can tell me how to create HP procurve port as trunk port. here i am giving my configuration

    • wr mem is just saving the config, so when its rebooting it will load the last saved config. If you change the snmp config, and the sw reboots, it wont have that change. wr mem does not cause a reboot.

  3. I am planning to disable SSH and web interface, but I would like to be able to manually re-enable as and when needed using the CLI. Is it possible? What is the command?

Leave a Reply

Your email address will not be published. Required fields are marked *