How to connect to switches?
The first possibility to connect to HP switch is using direct
console connection and access to the switch setup screen. For this you need an
adapter for
console cable that you can connect to your laptop.
Here i must say that with Windows laptop and
putty all my tryings to connect and access console direct were unsuccessful although all necessary drivers were installed. That's why i have used my
MacBook.
You have here also two variants of serial port access from your Mac.
The first one: with the help of some App. One good app that I've found for this purpose is
Serial - the connection is easy and needs nothing extra for this.
The second one: connect with the help of terminal. Here you must know some commands:
cd /dev
ls -ltr /dev/*usb*
crw-rw-rw- 1 root wheel 17, 8 22 Aug 16:21 /dev/tty.usbmodem1421
xvost-Laptop:dev xvostik$ screen /dev/tty.usbmodem1421
After all these commands the set-up screen open - you are connected with switch.
Also you can access your switch with
ssh or
telnet connection. For this i use putty tool from my Windows Laptop.
Switch menu
To access switch menu you must only type in console
menu
The window with menu is open. With the help of arrows ←↑↓→ you can move in this window.
Here you can find much useful information. To start initial setup, you need to choose menu
Run Setup
.
Here you can set up your device due to requirements.
General commands can be useful
show running-config
show ip
show version
show flash
show system
show ip ssh
show spanning-tree
SSH enable
To enable SSH you must switch in configuration modus:
configure terminal
Generate RSA key:
crypto key generate ssh
Enable SSH:
ip ssh
Disable telnet:
no telnet-server
(For enabling:
telnet-server
)
Time and timezone
To configure time and timezone you must also switch in configuration modus. Here is one example hot to adjust time for Central European Time UTC+01:00:
time daylight-time-rule western-europe
time timezone 60
time HH:MM MM/DD/YY
Remember: after any set up you must save your settings:
write memory
Exit from configuration modus:
exit
User and password
To create manager user and password you need to know only one command:
password manager user-name [user-name] plaintext [password]
Here you must be careful with password: if firmware on your device is old, can be it is not supported 16-numbers password or password with special characters.
Firmware update
How important to update your devices firmware i think is clear. With every version of firmware manufacturer try to close all possible security breaches. The latest firmware version for your HP switch you can find on
HP Enterprise Site. As security check you can also prove checksums from downloaded files or just scan them with some virus scanner.
Here is necessary to say that all HP switches have two images: primary and secondary, that saved in flash memory of the device. If primary image get wrong, device boots from the secondary image. To check the image version you can with command
show flash
.
For downloading firmware on your switch you need TFTP server. You can choose any you will find. My choice is
SolarWinds TFTP Server - free software easy to use.
To copy file on your switch you must start TFTP Server. The first one I copy the file for the secondary image. I make it just for testing if with image everything goes good and switch will work with it. If something goes wrong - you need just to plug out your switch and it will reboot from the primary image (which is the older version). The command for switch:
copy tftp flash [tftp-server IP] [firmware-file-name].swi [secondary]
Now I boot switch from the secondary image to check if everything goes good:
boot system flash secondary
Remember: it is good to monitor your switch in this moment to see it it works good. Sometimes CPU can be overloaded and then you have problems with your device. To see how it works all the time - just ping it from your terminal:
ping -t [switchIP].
If everything is good and your switch successfully rebbooted, you need to copy secondary firmware image in primary. Of course you can use again your TFTP Server and command
copy tftp flash [tftp-server IP] [firmware-file-name].swi [primary]
.
But more easy just copy image from secondary to primary:
copy flash flash primary
After that you need reboot your switch from primary image:
boot system flash primary