0% found this document useful (0 votes)
41 views5 pages

Switch Configuration With SYNTAX (Updated)

The document provides configuration syntax examples for basic switch configuration including assigning a hostname, enabling passwords, configuring interfaces, saving configurations, and banners. The examples show how to navigate configuration modes and perform tasks like enabling remote access, activating/deactivating interfaces, and setting messages of the day.

Uploaded by

jeevi27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views5 pages

Switch Configuration With SYNTAX (Updated)

The document provides configuration syntax examples for basic switch configuration including assigning a hostname, enabling passwords, configuring interfaces, saving configurations, and banners. The examples show how to navigate configuration modes and perform tasks like enabling remote access, activating/deactivating interfaces, and setting messages of the day.

Uploaded by

jeevi27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Basic Switch configuration SYNTAX

What for Configuration Syntax Comments


Factory default Switch prompt Switch>  this prompt with > is known as User mode

To go to PRIVILEGE MODE Switch> enable


Switch#  this prompt with # is known as Privilege mode
To go to GLOBAL MODE Switch # config t  this prompt with (config)# is known as Global Configuration
Switch (config) # mode
NOTE:
The values within { } braces are variables. So, you should change it according to your configuration need and braces are not part of commands
To assign Hostname for Switch Switch (config) # hostname {any name for the Switch such as S1}  Hostname can be any, it is a variable
Switch (config) # hostname S1  S1, is hostname for the switch here

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 go to Interface Gigabit 0/1 S1 (config) # int G0/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 save the configuration


What for Configuration Syntax Comments
To save the currently running S1# copy running-config startup-config Saves content or RAM to NVRAM, where NVRAM is Non-Volatile
configuration from RAM to startup memory. It keeps the configuration even if the router is turned
configuration NVRAM off.
Or

S1# copy run start


To save the currently running S1# copy running-config flash Flash is a kind of memory which stores IOS (Inter-network
configuration from RAM to FLASH Operating System). It can also keep backup files in it such as
running configuration. In order to keep the backup file, a user
Or must manually copy file to the FLASH memory.

S1# copy run flash NOTE:


A Switch or a Router has various types of memory such as –
RAM → [Volatile]
NVRAM → [Non-Volatile]
ROM → [Permanent]
Flash → [Stores IOS files and can be us to store backup files]
Message of the Day [motd] Banner SYNTAX
What for Configuration Syntax Comments
To configure message of the day Banner S1# config t  Banner shows the text within the quotation mark that
each time the user is trying to access the device using
S1(config)# banner motd “Authorized Access Only."
console or remote login.
S1(config)# exit

To assign IP on VLAN1 interface and gateway


What for Configuration Syntax Comments
To assign IP address on the Switch by using S1(config) # Interface VLAN 1  VLAN 1 is logical virtual interface for a switch
SVI (Switch Virtual Interface) S1 (config-if) # IP address {IP address} {Subnet Mask}  IP and SM for VLAN1 interface of the switch
S1 (config-if) # no shutdown  no shutdown turns on the VLAN1 interface
S1 (config-if) # exit

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.

To restart the Switch


What for Configuration Syntax Comments
To reboot the Switch R1 # reload  Restarts the Switch

To delete VLAN database in the Switch


What for Configuration Syntax Comments
To delete VLAN database R1 # delete vlan.dat  It deletes all the VLAN database that are stored in the Flash.
Once, the VLAN database is deleted then the switch resets the
VLAN into factory default VLAN, which is VLAN 1.

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

S1# show run

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 –

You might also like