Basic Commands

enable

conf t

exit

end

hostname SW100

copy running-config startup-config


Favorite Commands

wr

logging synchronous

no ip domain lookup

no enable password

show ip int brief

show vlan brief

L2 (show ip route) or L3 (show run | i ip route)

show vlan

IOS12 (show running-conf) or IOS15 (show running-config all)

show startup-conf

sh run | include def

show version

show clock detail

show ip ssh

show crypto key mypubkey rsa


Set ssh to version 2

show ip ssh

conf t

ip ssh version 2

exit

show ip ssh


Configure NTP Time Server

show ntp status

conf t

ntp server 172.16.200.14

exit

show ntp status

To remove: no ntp server 172.16.200.14

conf t

clock timezone PST -8

exit

show clock

Switch# clock set 08:45:00 08 December 2021

conf t

clock summer-time PDT recurring 2 Sun Mar 2:00 1 Sun Nov 2:00

exit

show clock


Generate RSA Key

ip domain-name iotnetwork.local

crypto key generate rsa

4096

RELOAD?


Add User

username web password my_password


Operating Mode

Layer 2 or switching mode (switchport command).

If the physical port is in Layer 2 mode (the default), you must enter the no switchport interface configuration command to put the interface into Layer 3 mode.

conf t

interface FastEthernet 1/2

no switchport

ip address 172.16.120.50 255.255.255.0

no shutdown

end


no ip domain lookup

traceroute 172.16.100.245

Escape Sequence (control+shift+6) and hold

(For Layer 2 Switch) show ip route

(For Layer 2 Switch) ip default-gateway 172.16.101.1

(For Layer 3 Switch) show run | i ip route

(For Layer 3 Switch) ip route 0.0.0.0 0.0.0.0 172.16.101.1


show int FastEthernet 1/2 switchport


Create Vlans

show vlan brief

conf t

vlan 20

vlan 30

show vlan brief

end

conf t

interface FastEthernet 1/2

switchport access vlan 20

end

show int FastEthernet 1/2 switchport

conf t

int vlan 20

ip address 172.16.20.1 255.255.255.0


Reload Switch

write erase

reload

delete flash:vlan.dat

reload


Trunks

show interface trunk

conf t

show run interface GigabitEthernet 1/1

interface GigabitEthernet 1/1

switchport mode trunk

exit

show interface trunk


Set IP

show int vlan 1

int vlan 1

ip address 171.16.100.100 255.255.255.0

show int vlan 1