11
Configuration d'un switch HP Procurve HP v1910-24G CLI Goody theITHollow.com lab suffered an outage to the core switch a few weeks ago (an aging Cisco 3750) and I was looking for a replacement that wouldn’t break the bank. Luckily I found the HP v1910-24G (JE006A) to be more than adequate. One of my main gripes with this switch was that the Command Line Interface was very limited. See for yourself. While the cli out of the box is nice, and I would say necessary, there isn’t a lot that can be done with it. For basic configuration tasks, you’ll be stuck with the Web GUI. But after digging through some HP discussion boards I found out that you can enable the Comware operating system commands. Add Comware CLI First things first, be sure to enable SSH or Telnet so that you can access the switch via a terminal emulator such as Putty. To do this, I used the web client.

Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

Embed Size (px)

Citation preview

Page 1: Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

Configuration d'un switch HP Procurve

HP v1910-24G CLI Goody

theITHollow.com lab suffered an outage to the core switch a few weeks ago (an aging Cisco 3750) and I

was looking for a replacement that wouldn’t break the bank. Luckily I found the HP v1910-24G (JE006A)

to be more than adequate. One of my main gripes with this switch was that the Command Line Interface

was very limited. See for yourself.

While the cli out of the box is nice, and I would say necessary, there isn’t a lot that can be done with it. For

basic configuration tasks, you’ll be stuck with the Web GUI. But after digging through some HP discussion

boards I found out that you can enable the Comware operating system commands.

Add Comware CLI

First things first, be sure to enable SSH or Telnet so that you can access the switch via a terminal emulator

such as Putty. To do this, I used the web client.

Page 2: Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

Next, use Putty to connect to the switch over SSH and login to the switch. Once you have a command line

interface, run the following command:

_cmdline-mode on

You will then be asked if you want to allow all commands to be executed. Of course you do! Then you’ll

be asked for a password which I found on this HP Discussion Board. The Password is 512900

Now that you’ve turned on the command line, you can use the normal Comware OS commands that you

may be accustomed to running in order to configure things like VLANS and things.

DISCLAIMER: Obviously you saw the warning in the previous screenshot that this should only be done

with an Engineer’s guidance so I’m sure this is unsupported by HP, don’t use this in a production

environment. I’m guessing this switch is used in a lot of labs which is why I’m posting the info.

Page 3: Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

If you are a Cisco or Procurve Admin and aren’t familiar with the syntax, I recommend looking at this

guide. I know that I did. One more thing I wanted to mention was that in Putty at least, the command line

can be a bit frustrating because the backspace button on your keyboard won’t work. I don’t know about

you but I mistype things all the time so this is a problem. To fix this, you can go to the Terminal –>

Keyboard section of Putty and change the Backspace Key from “Control-?(127)” to “Control-H” which

should resolve that issue for you.

Now you can use the

HP v1910-24G CLI to play around and configure your switch. Have Fun!

Page 4: Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

La première connexion s'effectue via le port console du switch. On utilisera pour cela un cable

série fourni en général avec le switch.

Nous aurons également besoin d'un terminal de connexion.

Exemples de logiciel client pour port série:

Pour Windows: hyperterminal, tera term pro

Pour Linux: minicom

Configuration du terminal

Présentation du mode console d'un switch HP

Mode avec et sans privilège

Une fois connecté, nous sommes placés dans un mode sans privilège. Il est possible dans ce

mode d'effectuer uniquement quelques commandes de diagnostique ou d'information. L'invite

de commande du mode sans privilège est la suivante: Switch> Pour pouvoir modifier la configuration, il faut passer en mode privilégié en entrant la

commande "enable". Switch>enable

Switch#

Console : autres modes

En fonction des commandes entrées, le switch va présenter des invites de commande

différentes.

Quelques exemples d'invite de commande en fonction du contexte:

switch-2850# conf t

switch-2850(config)#

Page 5: Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

Mode configuration d'une interface: switch_hp(config)# interface ethernet 2

switch_hp(eth-2)#

Navigation entre les modes

La commande exit permet d'accéder au contexte précédent. switch_hp(config)# interface ethernet 2

switch_hp(eth-2)#

Switch(config)#exit

Switch#

Enfin, la commande logout permet la déconnexion. switch-2850> logout

Do you want to log out [y/n]? y

Aide pour la console

Le point d'interrogation affiche les différentes commandes disponibles en fonction du

contexte dans lequel nous nous trouvons.

Par exemple: switch-2850#?

boot Reboot the device.

clear Clear table/statistics or authorized client public

keys.

configure Enter the Configuration context.

copy Copy datafiles to/from the switch.

debug Enable/disable debug logging.

end Return to the Manager Exec context. Le ? affiche les choix possibles lors de la frappe d'une commande.

Par exemple: Switch#sh?

Aide sur les commandes entrées

hp-2600(config)# hostname help

Usage: hostname ASCII-STR

Description: Specify the device name for administrative purposes. The

ASCII-STR defines the device name. It can be up to 30

characters. Use quotes if your device name contains

spaces.

hp-2600(config)# Enfin, ? nous indique les choix possibles lors de la frappe des caractères d'une commande.

Exemple: switch-2850# show ?

accounting Show Accounting configuration parameters.

arp Show the IP ARP translation table.

authentication Show Authentication configuration parameters.

authorization Show Authorization configuration parameters.

banner show the configured banner text.

boot-history Display the system boot log.

Page 6: Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

Commande abrégée

Il est souvent possible d'utiliser les commandes abrégées.

Par exemple les commandes suivantes envoient le même résultat:

switch-2850# show running-config

Running configuration:

; J9022A Configuration Editor; Created on release #N.11.15

hostname "switch-2850"

switch-2850# sh run

Running configuration:

; J9022A Configuration Editor; Created on release #N.11.15

hostname "switch-2850"

Complétion automatique des commandes

Il est possible de compléter automatiquement les premiers caractères d'une commande en

appuyant sur la touche tabulation.

<HPv1910>?

User view commands:

archive Specify archive settings

backup Backup next startup-configuration file to TFTP server

boot-loader Set boot loader

bootrom Update/read/backup/restore bootrom

cd Change current directory

clock Specify the system clock

cluster Run cluster command

copy Copy from one file to another

debugging Enable system debugging functions

delete Delete a file

dir List files on a file system

display Display current system information

fixdisk Recover lost chains in storage device

format Format the device

free Clear user terminal interface

ftp Open FTP connection

initialize Delete the startup configuration file and reboot system

ipsetup Specify the IP address of the VLAN interface 1

lock Lock current user terminal interface

logfile Specify log file configuration

mkdir Create a new directory

more Display the contents of a file

move Move the file

ntdp Run NTDP commands

password Specify password of local user

ping Ping function

pwd Display current working directory

Page 7: Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

quit Exit from current command view

reboot Reboot system

rename Rename a file or directory

reset Reset operation

restore Restore next startup-configuration file from TFTP server

rmdir Remove an existing directory

save Save current configuration

schedule Schedule system task

screen-length Specify the lines displayed on one screen

send Send information to other user terminal interface

sftp Establish one SFTP connection

ssh2 Establish a secure shell client connection

stack Switch stack system

startup Specify system startup parameters

summary Display summary information of the device.

super Set the current user priority level

system-view Enter the System View

telnet Establish one TELNET connection

terminal Set the terminal line characteristics

tftp Open TFTP connection

tracert Trace route function

undelete Recover a deleted file

undo Cancel current setting

upgrade Upgrade the system boot file or the Boot ROM program

When you type SYS of system-view. You will get the list of system admin commands.

<HPv1910>system-view

System View: return to User View with Ctrl+Z.

[HPv1910]?

System view commands:

aaa Specify AAA configuration

acl Specify acl configuration information

archive Specify archive settings

arp Specify ARP configuration information

bootrom-update bootrom update

clock Specify the system clock

cluster Specify cluster configuration information

command-privilege Specify the command level

configuration Specify configuration settings

copyright-info Copyright information configuration

cut Cut connection

delete Delete function

dhcp DHCP configuration subcommands

dhcp-snooping DHCP Snooping

display Display current system information

domain Add domain or modify domain attributes

dot1x Specify 802.1X configuration information

execute Batch Command

file Specify file system configuration information

ftp Specify FTP configuration information

gratuitous-arp-learning Gratuitous Arp learning function

gratuitous-arp-sending Sending gratuitous-arp packet when receiving

different sub-network arp packet function

habp Specify HABP configuration information

header Specify the login banner

hotkey Specify hotkey configuration information

igmp-snooping IGMP snooping

info-center Specify information center configuration

information

interface Specify the interface configuration view

Page 8: Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

ip Specify IP configurations for the system

job Schedule a system task

jumboframe Jumboframe command

lacp Configure LACP Protocol

lldp Link Layer Discovery Protocol(802.1ab)

local-user Specify local user configuration information

logfile Specify log file configuration

loopback-detection Detect if loopback exists

mac-address Configure MAC address

mirroring-group Specify mirroring-group

multicast-vlan Multicast VLAN

ndp Neighbor discovery protocol

ntdp Specify NTDP configuration information

ntp-service Specify NTP(Network Time Protocol) configuration

information

ping Ping function

pki Specify PKI module configuration information

port-group Port group

public-key Specify public-key module configuration

information

qos Command of QoS(Quality of Service)

quit Exit from current command view

radius Specify RADIUS configuration information

return Exit to User View

rmon Specify RMON

save Save current configuration

sftp Specify SFTP service attribute

snmp-agent Specify SNMP(Simple Network Management Protocol)

configuration information

ssh Specify SSH (secure shell) configuration

information

ssl Specify SSL (Secure Socket Layer) configuration

information

stack Switch stack system

storm-constrain Port storm-constrain

stp Spanning tree protocol

super Modify super password parameters

sysname Specify the host name

system-failure System failure handling method

system-guard System guard function

tcp Specify TCP(Transmission Control Protocol)

configuration information

telnet Specify TELNET configuration information

temperature-limit Set temperature limit

tftp Specify TFTP configuration information

tftp-server TFTP Server

time-range Specify time-range configuration information

tracert Trace route function

traffic Specify traffic configuration information

undo Cancel current setting

user-group Specify user group configuration information

user-interface Configure the user terminal interface

vlan Configure VLAN

voice Specify voice VLAN

web Web configuration

Page 9: Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

HowTo: HP Procurve v1910 – Enable the Secret

Command Line Mode

April 4, 2014

Gabriel Matteson

Comment

HP,HP Procurve Networking

Tags: networking, procurve

Enable the Secret Command Line Mode

1. SSH into the switch.

2. To enable the secret command line commands you have to type the following command:

_cmdline-mode on

Page 10: Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

3. You will get a question. Answer this question with Yes.

4. If you don’t have a password you will get a popup notification on the CLI, type in the following code:

512900

Page 11: Add Comware CLI - paulodossantos.ch Documents... · theITHollow.com lab suffered an outage to the core switch a few weeks ago ... aaa Specify AAA configuration ... dot1x Specify 802.1X

The default command line view is the User View. Type ? and press Enter, to list all available commands.

<HPv1910>?

User view commands:

To view all system level commands, Type system-view and press Enter. To list all available commands type ? and press Enter.

<HPv1910>system-view

System View: return to User View with Ctrl+Z.

[HPv1910]?