➥ Often used commands in cisco switches

Here are some often used commands by sysadmins in cisco switches.

show mac address-table interface g1/0/3
show interfaces status
show ip int
show run int g1/0/14 | b interface -> SHOW NATIVE VLAN
show vlan -> SHOW VLANS
sh ver | s uptime -> UPTIME
show interfaces description -> SHOW DESCRIPTION


STOP PASS FOR DAYS (Cisco SG300 only)
1. conf t
2. passwords aging 0


ADD PORT TO VLAN ACCESS
1. conf t
2. interface g1/0/XX (interface range gi1-26)
3. description
4. switchport mode access
5. switchport access vlan ID
6. exit
7. exit
8. writeco


ADD VLAN
1. conf t
2. vlan database
3. vlan XX
4. exit
5. interface vlan XX
6. name XXXX
6. exit
7. show vlan
8. write


DELETE VLAN
1. conf t
2. vlan database
3. no vlan XX
4. exit
5. exit
6. sh vlan


ADD NAME TO VLAN
1. con t
2. interface vlan 7
3. ?


TRUNK VLAN
1. conf t
2. interface geXX
2.1 no spanning-tree disable * ако порта до сега е бил там
3. switchport mode trunk
5. switchport trunk native vlan 999
6. switchport trunk allowed vlan add all
( switchport trunk allowed vlan remove 1,2,3 blq blq )
( za sg300 #switchport default-vlan tagged)


ADD SNMP Communities
1. conf t
2. snmp-server community public RO
(for Read Write)
2.1. snmp-server community private RW


TIME
1. show clock, show sntp status
2. conf t
3. sntp server 10.20.6.29 poll
4. clock timezone UTC +2
5. clock source sntp


REMOTE SYSLOG SERVER
router#conf t
Router(config#logging host x.x.x.x
Router(config)#logging trap (i.e 0 1 2 3 4 5 .. according to your requirement)
-----additional-----
clear logging
show logging


SHUTDOWN OR ENABLE PORT
SHUTDOWN
conf t
interface gigabitethernet0/2
shutdown
ENABLE
interface gigabitethernet0/2
no shutdown