Switch Configuration
Switch Basic Configuration:
If we have to configure the switch and connect three PCs at the Port F0/1, F0/2, and F0/3, we will take the Switch of 8 Ports.After booting the Switch, the switch will have the prompt similar to a router.
Switch> enable
Switch# configure terminal
Switch(Config)# hostname Norman_Switch
Norman_Switch(config)# interface f0/1
Norman_Switch(config-if)# switchport mode access
Norman_Switch(config-if)# exit
Norman_Switch(config)# interface f0/2
Norman_Switch(config-if)# switchport mode access
Norman_Switch(config-if)# exit
Norman_Switch(config)# interface f0/3
Norman_Switch(config-if)# switchport mode access
Norman_Switch(config-if)# exit
Norman_Switch(config)# exit
Norman_Switch#
All the ports will be UP and all three PCs can ping each other, as they are in a LAN.
Switch Memory
Similar to a router, a switch also has three types of memory:
- Running-config, which stores the running-configuration. Volatile memory.
- Startup-config, which stores the saved configuration. It is non-volatile memory.
- Flash memory, in which the IOS is stored in a .bin file.
Switch Security:
Port security
Consider a Switch that has two PCs Connected with the following MAC Address:
Configureing the Switch interface with port security. If other PC’s are connected to it, the pPort will be sShut down. This mMeans other PCspc can’t connect to the Switch.
Switch> enable
Switch# configure terminal
Switch(Config)# hostname Norman
Norman(Config)# interface range f0/1-2
Norman(Config-if)# switchport mode access
Norman(Config-if)#exit
Norman(Config)# interface f0/1
Norman(Config-if)# switchport port-security mac-address 0090.2B53.C7A9
Norman(Config-if)# switchport port-security violation shutdown
Norman(Config-if)# exit
Norman(Config)# interface f0/2
Norman(Config-if)# switchport port-security mac-address 0001.427D.48AD
Norman(Config-if)# switchport port-security violation shutdown
Norman(Config-if)# exit
Now, if another PCpc connects to F0/1 or F0/2 of the switch, it will not be able to connect.
These above ports will shut down.
Creating Password:
These commands are similar to router commands.
Switch> enable
Switch# configure terminal
Switch(Config)# enable secret norman123
For Console
Switch(config)# line console 0
Switch(config-line)# password norcon123
Switch(config-line)# login
Switch(config-line)# exit
For Telnet
Switch(config)# line vty 0 1
Switch(config-line)# password nortel123
Switch(config-line)# login
Switch(config-line)# exit
Switch(config)# service password-encryption
Switch(config)# do show running-config
Switch(config)# do write memory (for saving configurations)
Switch(config)# do show startup-config