cisco ios


QUICK Switch setup


Environment Cisco Switch

  • Connect a console cable from your PC to the Switch

  • Open device manager / Ports to view your serial COM

  • open PuTTY and connect to switch via Serial / COM


- PASSWORD RECOVERY

  • Interrupt the boot process to enter ROMmon mode

  • Hold the "mode" button on the switch and power it up

  • Release the button after "the password-recovery mechanism is enabled" message


The system has been interrupted prior to initializing the

flash filesystem. The following commands will initialize

the flash filesystem, and finish loading the operating

system software:


flash_init

boot



switch: flash_init

switch: delete flash:config.text This will delete the current config

Are you sure you want to delete "flash:config.text" (y/n)? y

File "flash:config.text" deleted


Would you like to enter the initial configuration dialog? [yes/no]:

no


Switch>en

Switch#config t

Switch(config)#hostname SwitchName This will set the hostname

Switch(config)#ip domain-name domain.com This assigns a domain

Switch(config)#banner motd #This is a switch, stay out!# Add a banner

Switch(config)#enable secret password Set the password

Switch(config)#username user secret password Create user

Switch(config)#crypto key generate rsa Create crypto key for SSH


How many bits in the modulus [512]: 1024


Switch(config)#ip ssh ver 2 Update to version 2

Switch(config)#service password-encryption Encrypt passwords in the config

Switch(config)#line con 0

Switch(config-line)#password pass Set password for switch login

Switch(config-line)#login

Switch(config-line)#exit

Switch(config)#line vty 0 4

Switch(config-line)#login local Use the local username and password on the switch

Switch(config-line)#transport input ssh SSH is enabled

Switch(config-line)#exit

Switch(config)#interface vlan 1 Create a Switch Virtual Interface

Switch(config-if)#ip address 10.0.0.5 255.255.255.0 assign an IP address to the virtual interface/switch

Switch(config-if)#no shutdown

Switch(config-if)#exit

Switch(config)#exit

Switch#copy running-config startup-config (copy run start)

Destination filename [startup-config]? (hit enter)

Building configuration ...

[OK]

Switch# (The config has now been saved)


- CREATING A VLAN


Switch#

Switch#config t

Switch(config)#vlan 13 create a vlan

Switch(config-vlan)#name Vlan-name name the vlan

Switch(config-vlan)#exit

Switch(config)#show vlan to see the new vlan

Switch(config)#interface fastEthernet 0/1


*if fastEthernet is the incorrect syntax

Switch(config)#do sh int status to see the interfaces/ports


Switch(config)#interface gi1/0/1 (another example - port 1)

- Switch(config)#interface range gi1/0/2-10 (this would assigned ports 01 to 10)

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 13

Switch(config-if)#exit

Switch(config)#


Port 1 is now assigned to vlan 13


Switch(config)#interface vlan 13

Switch(config-if)#ip address 10.0.13.1 255.255.255.0 assign the ip 10.0.13.1 to vlan 13

Switch(config-if)#exit

Switch(config)#do show ip interface brief (to show)

Switch(config)#ip routing turn on ip routing


- USEFUL INFO COMMANDS

- Switch#show ip interface brief - ports config

- Switch#sh int status - all ports

- Switch#sh int - switch config

- Switch#show vlan - show vlans

- Switch#show interface gi1/0/24 to see config of port 24


- TRUNKING SWITCHES

- Repeat the same on each switch


Switch#config t

Switch(config)#interface gi1/0/24 to select port 24


Switch(config-if)#swichport trunk encapsulation dot1q switch 24 is now a trunk


*if encapsulation is the incorrect syntax

Switch(config)#trunk allow native to allow all vlans to trunk on the port

Switch(config)#trunk allow vlan 13 to allow only specific vlans on the port


Switch(config)#switchport mode trunk enables the port as trunk


Plug an ethernet cable into each switches port 24 to connect/trunk them.