-
Notifications
You must be signed in to change notification settings - Fork 0
Cisco IOS CLI
-
connect the switch to the computer
-
open a terminal over serial port (with putty)
enable
Hit enter
several times to proceed to command line.
if command line shows a lot of data with
-more-
sign, pressenter
to proceed line by line, orspace
to proceed page by page, orQ
to ignore extra data.
Simple commands:
show clock
show version
Show available commands:
show ?
Add ?
to show extra arguments of the command:
show clock ?
You can shorten the commands, until it does not conflict with another command:
show clock detail
sh clo de // OK
sh cl de // ambiguous
To get out of any config mode:
exit // takes back one level
or
CTRL + Z // takes back all the way to the global exec level
set login banner text:
banner login #
enter some text
#
show the current configuration data in volatile memory:
show running-config
show saved config in non-volatile memory:
show startup-config
save the running config:
copy running-config startup-config
or
copy run start
show list of files/folders in the memory:
dir
check for available VLANs:
show vlan
Create a VLAN:
config
vlan database // enter vlan database mode
vlan <ID>
end
configure t
Inside each type of configuration modes, you have not access to global commands, unless you add a
do
keyword
config terminal
do show clock
hostname NameForSwitch
enter created VLAN in interface mode:
int vlan <CREATED ID>
assign static IP address to the switch:
ip address 192.168.71.3 255.255.255.0
to show the settings:
do show int vlan1
then you can ping the switch from outside
show available interfaces on the switch:
show ip interface brief
to configure an interface:
interface gigabit 0/1 // each interface you want to config
add description to the interface:
description SOME TEXT
set IP address to the interface:
ip address 192.168.0.1 255.255.255.0
to shut the interface down:
shutdown
to bring the interface up and running:
no shutdown
check for number of VTYs:
line vty 0 ?
set password for SSH:
line vty 0 15
password PASSWORD
login
exit
line vty 0 15
transport input ssh
login local
exit
ip domain-name someaddress.com
crypto key generate rsa // give 2048 bits
ip ssh version 2
line con 0 // for console port
password PASSWORD
login
exit
line aux 0 // for auxillary port
password PASSWORD
login
exit
set an encrypted password for enable mode:
enable secret PASSWORD
encrypt the rest of passwords:
run service password-encryption
then you can encrypt each password using method 5:
password PASSWORD 5 encrypted-secret
make a user with certain access level (15 is the highest):
username ADMIN privilege 15 secret PASS
show power inline