HP ProCurve CLI CheatSheet

@http://blog.petrilopia.net/info/hp-procurve-cli-cheatsheet-2/

HP ProCurve CLI CheatSheet

LOG
log Display log events (most recent last)
log -r Display log events (most recent first)
log A12 Display log events of port a12
log A12 -r Display log events of port a12 (most recent first)
log 192.168.0.1 Display log events of 192.168.0.1

 

MAC
show mac A5 Show MAC-address of the device on port A5
show mac A4-A6 Show MAC-adresss of the devices on ports between A4 and A6
show mac 00112233-445566 Show which port device with MAC-address 00112233-445566 is connected

 

VLAN
show vlan Show information about vlans on this swtich
show vlan ports A19 Show VLAN ID and status of specific ports (A19)
show vlan Show ports on this vlan and port status
configure
vlan 19 Set switch to vlan 19
name SupportVLAN Name this vlan as “SupportVLAN”
tag A12 Set port a12 as tagged on vlan 19 (First do vlan <19>)
tag A12,A13 Set ports a12 and 13 tagged on vlan 19 (First do vlan <19>)
untag A12 Set port a12 as untagged on vlan 19
vlan 19 tagged A12 Set port a12 as tagged on vlan 19
vlan 19 untagged A12 Set port a12 as untagged on vlan 19
vlan 19 untagged A12-A20 Set port a12-a20 as untagged on vlan 19
no vlan 30 Remove vlan setting on port 30

 

FLASH
show flash Displays info about flash (version etc.)
copy running-config tftp filename.txt Copy your running config to file filename.txt at tftp server which IP is .
copy tftp startup 192.168.0.2 hp_2524 Copy your config (filename hp2524) from server 192.168.0.2 via tftp to switch
copy tftp flash file.swi Download and update your flash with file.swi from tftp server at

 

MISC
copy flash flash secondary Copy software from primary to secondary image is not intuitive
copy flash flash primary Updated secondary image first then You could copy from secondary to primary
hostname poro_1 Set switch hostname as poro_1
link-test 00112233-445566 Test connectivity between switches (this switch and 00112233-445566)
show run Show running config
password operator Set operator password (Normal user / read-only )
password manager Set manager password (Admin user / read-write)
password all Set operator and manager password
enable Switch to manager lever from operator level
ping 192.168.0.1 Ping IP 192.168.0.1
chassislocate Turn on/off switch locator led or blink it (30 minutes)
chassislocate blink 10 Blink switch locator led 10 minutes
ntp1 first.timeserver.net Add first.timeserver.net to NTP server list
timesync ntp Enable NTP syncronization with servers

 

PROMPT
Switch# Manager prompt
Switch>_ Operator prompt

 

send “show tech all” from a HP switch to a tftp server

Introduction

A ‘show tech all’ file contains a lot of information from the switch. Although it is possible to capture this output using session logging in your telnet or terminal emulator application, it is better to transfer the file via TFTP. Session logs tend to have a lot of control sequences embedded which makes it difficult for us to analyze the file.

 

If you do not have IP connectivity on the switch and the switch has a console port, it is possible to transfer the ‘show tech all’ file via the console cable, see at the end of this document.

Requirements

* You must have a TFTP server running on a PC (See ‘obtaining a TFTP server’ below)

* Your switch must have IP connectivity to the PC running a TFTP server

* You must have command line access to the switch

Obtaining a TFTP server

You can download a simple and easy to use TFTP server for free from http://www.solarwinds.com/

 

Alternatively you can download TFTPd32 from http://tftpd32.jounin.net/ which also includes simple SNTP, syslog and DHCP servers.

Obtaining the ‘show tech all’ via TFTP

Start your TFTP server:

tftp

 

Notice the ‘Current Directory’ setting; this is where the file from the switch will end up.

 

Also notice the ‘Server interfaces’ setting; this is the IP address you will specify on the switch command line when creating the ‘show tech all’ file.

 

 

Connect to the command line of the switch and log in if needed. You should NOT be in configuration mode on the switch, but you do need to be in enable (manager) mode. Issue the following command:

 

Switch# copy command-output ‘show tech all’ tftp 12.23.34.45 xxxx.txt

 

Where 12.23.34.45 is the IP address of the PC running the TFTP server, and xxxx is something to identify the switch.

 

 

The switch will now generate the required file, and transfer it to your PC via TFTP. You can pick up the file in the “Current Directory” folder and e-mail it to ProCurve support.

Obtaining the ‘show tech all’ via console cable

If there is no IP connectivity to the switch, it is still possible to obtain a ‘show tech all’ file if the switch has a console port. You can use Hyper Terminal which is typically installed with Windows, or you may choose to use a free application like Tera Term (http://en.sourceforge.jp/projects/ttssh2/releases/).

 

Connect the serial cable between your computer and the switch. Establish a connection, the parameters are 9600,8,N,1,N (9600 baud, 8 bits, no parity, 1 stop bit, no flow control).

 

***NOTE*** If the above settings don’t respond and you have a newer RJ45 looking Serial port on the switch use XON/XOFF instead of NONE at the last setting (Flow Control)***

 

 

When you have command line access via the console, issue the following command:

 

Switch# copy command ‘sh tech all’ xmodem

 

Now instruct the terminal emulator application to receive the file:

 

Hyper Terminal – In the menu select Transfer->Receive File, Set receiving protocol to XMODEM, and note the destination directory. Click Receive, name the file, and save.

 

Tera Term – In the menu select File->Transfer->XMODEM->Receive, name the file, and save.

 

Once the file transfer has completed, you can e-mail it to HPN support.

 

Note that the switch may time out before you start receiving the file. Simply press Arrow Up in the terminal session, re-execute the command, and try again.

 

Logging the output of ‘show tech all’ via a terminal emulator:

Choose Transfer -> Capture Text or the follow the examples below.

This opens a window where you can scroll down to the folder where you wish to save the logs to. In this “Browse” window you can also define a name for the log file, for instance YYYY-MM-DD-HH-MM.txt

hyperterminalputty

 

 

***If your preferred terminal emulator is Putty, ensure that you tick the option enabling “Printable output. ***

 

log

 

Choose the folder you wish to save the logs to. Your desktop is preferable.

Now your switch will send its logs to the file on your desktop, as long as it is connected via your terminal emulator.

 

download as word file: [wpdm_file id=83]

Finding and changing the MTU in Windows 7/2012

In computer networking, the maximum transmission unit (MTU) of a layer of a communications protocol is the size (in bytes) of the largest protocol data unit that the layer can pass onwards. MTU parameters usually appear in association with a communications interface (NIC, serial port, etc.). …

 

To find the MTU for Windows 7, type the following command at a DOS prompt:

netsh interface ipv4 show subinterfaces

 

To change the MTU for an adapter use the following command example:

netsh interface ipv4 set subinterface “Local Area Connection” mtu=1458 store=persistent

 

The following table summarizes the default MTU sizes for different network media.

 

  Network             MTU (bytes)
   -------------------------------
   16 Mbps Token Ring        17914
   4 Mbps Token Ring          4464
   FDDI                       4352
   Ethernet                   1500
   IEEE 802.3/802.2           1492
   PPPoE (WAN Miniport)       1480
   X.25                        576

Scan fast multiple subnets to CSV files

I need multipe subnets scanned and need an outpu to a CSV file.

For this i will use a program called Softperfect Network Scanner. You candownload it from their website or download it here: [wpdm_file id=80]

First i’ll create an config file which has the settings i need:

I only need the ip, hostname and response time. So i will hide the MAC address from the View menu (Visible Columns). Also i do not need to scan a mac address and shared folders which are enabled by default. I will open the Program Options under the Options memu (or CTRL+K) and deselect the resolve MAC addresses under the Additional tab. Under the Shares tab i deslect the Scan for shared resources.

Now my config is like I want it, I need to save it to a xml file. I save the running config file to xml. Choose File, Current Config, Save to file and place it with the netscan.exe in a folder.

In the online manual you can read all other parameters to scan, but i use the simple command:

netscan /range:172.16.0.1-172.16.0.255 /auto:result.csv

This command will scan all devices within the 172.16.0.0/24 range and save it to a file called result.csv