Basic Switch Configuration

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Basic Switch Configuration

1. Change the name of a switch

User mode switch>enable


Privileged mode switch#configure terminal
Configuration mode switch(config)#hostname SW1
Configuration mode SW1(config)#exit
Privileged mode SW1#

2. Enable password to line console

User mode SW1>enable


Privileged mode SW1#configure terminal
Configuration mode SW1(config)#line console 0
Sub configuration mode SW1(config-line)#password cisco
Sub configuration mode SW1(config-line)#login
Sub configuration mode SW1(config-line)#end
Privileged mode SW1#

3. Enable password to remotely access interface

User mode SW1>enable


Privileged mode SW1#configure terminal
Configuration mode SW1(config)#line vty 0 5
Sub configuration mode SW1(config-line)#password cisco
Sub configuration mode SW1(config-line)#login
Sub configuration mode SW1(config-line)#end
Privileged mode SW1#

4. Enable password to privileged configuration mode

User mode SW1>enable


Privileged mode SW1#configure terminal
Configuration mode SW1(config)#enable secret cisco
Configuration mode SW1(config)#exit
Privileged mode SW1#

Note: You have to save configuration and reload to activate passwords.


5. Configuring ip address to vlan 1

User mode SW1>en


Privileged mode SW1#conf t
Configuration mode SW1(config)#interface vlan 1
Sub configuration mode SW1(config-if)#ip address 10.10.10.2
255.255.255.0
Sub configuration mode SW1(config-if)#no shutdown
Sub configuration mode SW1(config-if)#end
Privileged mode SW1#

6. Configuring default gateway

User mode SW1>en


Privileged mode SW1#conf t
Configuration mode SW1(config)#ip default-gateway 10.10.10.1
Configuration mode SW1(config)#end
Privileged mode SW1#

7. Saving configuration

User mode SW1>en


Privileged mode SW1#copy running-config startup-config
Or
SW1# copy run start
Or
SW1#wr
Privileged mode SW1#

8. Configure banner message to switch

User mode SW1>en


Privileged mode SW1#conf t
Privileged mode SW1(config)#banner motd #YOUR MESSAGE#

9. Encrypt all passwords

User mode SW1>en


Privileged mode SW1#conf t
Configuration mode SW1(config)# service password-encryption
Configuration mode SW1(config)#end
Privileged mode SW1#
Note: this configuration works for routers also.
Basic configuration for a router

1. Change the name of a router

User mode router>enable


Privileged mode router#configure terminal
Configuration mode router(config)#hostname R1
Configuration mode R1(config)#exit
Privileged mode R1#

2. Enable password to line console

User mode R1>enable


Privileged mode R1#configure terminal
Configuration mode R1(config)#line console 0
Sub configuration mode R1(config-line)#password cisco
Sub configuration mode R1(config-line)#login
Sub configuration mode R1(config-line)#end
Privileged mode R1#

3. Enable password to remotely access interface

User mode R1>enable


Privileged mode R1#configure terminal
Configuration mode R1(config)#line vty 0 5
Sub configuration mode R1(config-line)#password cisco
Sub configuration mode R1(config-line)#login
Sub configuration mode R1(config-line)#end
Privileged mode R1#

4. Enable password to privileged configuration mode

User mode R1>enable


Privileged mode R1#configure terminal
Configuration mode R1(config)#enable secret cisco
Configuration mode R1(config)#exit
Privileged mode R1#

5. Configure banner message

User mode R1>en


Privileged mode R1#conf t
Configuration mode R1(config)#banner motd #YOUR MESSAGE#
Configuration mode R1(config)#exit
Privileged mode R1#
6. Configuring address to gigabitEthernet, fastEthernet or serial interface

User mode R1>en


Privileged mode R1#conf t
Configuration mode R1(config)#interface gigabitEthernet 0/0
Sub configuration mode R1(config-if)#ip address 10.10.10.1
255.255.255.0
Sub configuration mode R1(config-if)#no shutdown
Sub configuration mode R1(config-if)#end

7. Configuring static routes for routers

User mode R1>en


Privileged mode R1#conf t
Configuration mode R1(config)#ip route (destined network)
(subnet mask of network) (next hop)
R1(config)#ip route 10.10.30.0 255.255.255.0
1.1.1.2
Configuration mode R1(config)#end

8. Configure description for interfaces

User mode R1>en


Privileged mode R1#conf t
Configuration mode R1(config)#interface gig 0/0
Sub configuration mode R1(config-if)#description YOURDISCRIPTION
Sub configuration mode R1(config-if)#end

9. Show running configuration

User mode R1>en


Privileged mode R1#show run

10. Show routing table

User mode R1>en


Privileged mode R1#show ip route

11. Show ARP table

User mode R1>en


Privileged mode R1#show ip arp

You might also like