Switch Configuration With SYNTAX (Updated)
Switch Configuration With SYNTAX (Updated)
To enable plain text password S1 (config) # enable password {any password you like to have} Password can be any, it is a variable
NOTE: this is plain text mode password
To enable encrypted password S1 (config)# enable secret {any password you like to have but must be Password can be any, it is a variable
different from enable password} Enable secret creates an encrypted hashed password
NOTE:
If you have both ‘enable password’ and ‘enable secret’
passwords in your configuration then secret password is the first
priority among them. Hence, when you type password you have
to provide the secret password.
To go to Interface FastEthernet 0/1 S1 (config) # interface F0/1
S1 (config-if) # migrates from config mode to interface mode
To activate remote TELNET ACCESS S1 (config) # line vty 0 4 VTY stands for Virtual Teletype.
S1 (config-line) # password {any password you like to have} 0 4 opens up remote login services on the Switch for 5
S1 (config-line) # login different devices to login simultaneously
S1 (config-line) # exit Password to connect the switch via remotely
‘login’ allows to login remotely for vty users and asks password
NOTE:
Telnet does not encrypt the communication between remote users
and the local R1router. Transaction happens in plain text only.
To assign password on CONSOLE PORT S1 (config) # line con 0 ‘Console 0’ is a physical port on a Switch that allows to connect
S1 (config-line) # password {any password you like to have} a computer to manage a Switch using terminal applications such
S1 (config-line) # login as Putty, Hyper Terminal, SecureX, Minicom etc.
S1 (config-line) # exit
NOTE:
‘Login’ command allows to login to the device but asks the
password while the user is trying to login to the device.
To exit S1 (config) # exit ‘exit’ is to go back to previous prompt
S1 #
To de-activate the switch port Interface S1 (config) # interface f0/1 port numbers can vary from FastEthernet 0/1-0/24 or
(NOTE: By default, all the ports are S1 (config-if) # shutdown GigabitEthernet 0/1 - 0/2.
enabled)
shuts down the port F0/1.
To de-activate the switch port Interface S1 (config) # int f0/24 shuts down port F0/24
S1 (config-if) # shutdown
To activate the switch ports Interface S1 (config) # interface f0/1 enables the port F0/1
(NOTE: By default, all the ports are S1 (config-if) # no shutdown
enabled)
To assign gateway on the Switch S1(config)# ip default-gateway {IP address of default gateway} IP address of default gateway should be router’s ethernet
interface IP.
NOTE:
Normally all the switch ports belong to VLAN 1 by default.
Show commands SYNTAX
What for Configuration Syntax Comments
To display current contents of RAM (running S1# show running-config displays entire configuration of router that is currently
configuration) running on the RAM
Or
To display the current contents of non-volatile random- S1# show startup-config If you have not saved running-config from RAM to startup-
access memory (NVRAM) config i.e. NVRAM then it may say “startup-config is not present”.
Or
Hence, it is a must to do “copy running-config startup-config”
S1# show start prior to run “show start” command.
To show the contents of the FLASH S1 # show flash: shows all the contents of flash: memory. Normally flash: is the
home for IOS file(s).
NOTE:
A Switch or A Router has various types of memory such as –
RAM
NVRAM
ROM
FLASH
To show status of all the interfaces briefly S1# show ip interface brief It shows brief information of all the interfaces as seen below –