Switching Technology Commnds

Cisco Router & Switch Ether-Channel

				
					Router
......
int port-channel 1
no shutdown
exit

int fa0/0
channel-group 1
no shutdown
exit

int fa0/1
channel-group 1
no shutdown
exit

int port-channel 1
ip add 192.168.1.1 255.255.255.0
no shutdown.
exit


Switch
......
int range fa0/1-2
channel-group 1 mode on
exit

int port-channel 1
exit
				
			

Layer 2 Switch To Switch Ether-channel

				
					Switch1
........
interface range fa0/1-2
channel-group 1 mode active


Switch2
.......
interface range fa0/1-2
channel-group 1 mode passive


How To Ether-Channel Checking
.............................
show etherchannel summary
show etherchannel detail
show etherchannel port-channel
				
			

L3 Etherchannel Multilayer Switch

				
					Switch1
........
int fa0/1
no switchport
ip address 10.10.10.1 255.255.255.0
no shutdown
exit

hostname sw1

int portchannel 1
no switchport
ip address 172.16.1.1 255.255.255.0
no shutdown
exit

int range fa0/2-3
no switchport
channel-group 1 mode active



Switch2
........
int fa0/1
no switchport
ip address 11.11.11.1 255.255.255.0
no shutdown
exit
hostname sw2

int portchannel 1
no switchport
ip address 172.16.2.1 255.255.255.0
no shutdown
exit

int range fa0/2-3
no switchport
channel-group 1 mode passive
				
			

Router To Router Ether-channel

				
					Router1
int port-channel 1
no shutdown
exit

int fa0/0
channel-group 1
no shutdown
exit

int fa0/1
channel-group 1
no shutdown
exit

int port-channel 1
ip add 192.168.1.1 255.255.255.0
no shutdown.
exit

Router2
int port-channel 1
no shutdown
exit

int fa0/0
channel-group 1
no shutdown
exit

int fa0/1
channel-group 1
no shutdown
exit

int port-channel 1
ip add 192.168.1.1 255.255.255.0
no shutdown
exit
				
			

Configuring VLANs on Cisco Switches

				
					Creating the VLAN in the VLAN Database Switch1

vlan 10
name RED
exit

vlan 20
name ORANGE
exit

vlan 30
name BLUE
exit

Assigning the Switchport to a VLAN
..................................

interface Ethernet 0/2
switchport mode access
switchport access vlan 10
exit

interface Ethernet 0/3
switchport mode access
switchport access vlan 30
exit

Creating a trunk port 
.....................

interface Ethernet 2/1
switchport trunk encapsulation dot1q
switchport mode trunk
exit

interface Ethernet 2/2
switchport trunk encapsulation dot1q
switchport mode trunk
exit

To set the Native VLAN Untag Traffic
interface Ethernet 2/1
switchport trunk native vlan 3
exit

interface Ethernet 2/2
switchport trunk native vlan 3
exit

Allowed VLAN List
.................
interface Ethernet 2/1
switchport trunk allowed vlan 10,20

switchport trunk allowed vlan 20
switchport trunk allowed vlan add 30

interface Ethernet1/1
switchport trunk allowed vlan remove 20

interface Ethernet1/1
no switchport trunk allowed vlan
				
			

Show Commnd

				
					Switch
.......
show vlan brief <Check VLAN>
show interfaces trunk <Check Trunk Port>
show interfaces switchport
show interfaces status
show spanning-tree


Router
.......
show startup-config
show running-config
show clock
show hosts
show users
show arp
show protocols
show history
show ip route
show version
show ipv6 route
show interfaces
show interfaces gigabitEthernet 0/0
show ip interface brief
show ipv6 interface brief
show cdp neighbors
show ntp status
show Flash:
show logging
show access-lists
show ip dhcp binding
show ip dhcp pool
show ip eigrp neighbors
show ip ospf neighbor
show ip nat translations
show standby
show mac address-table
show spanning tree summary
show etherchannel
show vlan
show vtp status
show port-security
show monitor session all
show interfaces status
show interfaces switchport
show interfaces trunk
				
			
				
					...Switching Commnd...

To log into global configuration mode
.....................................
configure terminal

To log into the privileged exec mode
....................................
enable


To reboot the switch
....................
reload 


To set the hostname
...................
hostname Sw1


To merge the startup configuration with the configuration in memory
..................................................................
 Copy startup-config running-config 


To replace and Save the startup configuration with the startup configuration
............................................................................
Copy running-config startup-config 


To display startup configuration which is activated when device starts
......................................................................
show startup-config 


To display current configuration
................................
show running-config


shut the interface
..................
int fa0/1
shutdown


bring up the interface
......................
int fa0/1
no shutdown


To display the status of a network interface and its IP configurations
......................................................................
show ip interface 0/0


To show the MAC address table
.............................
show mac address-table 


To display information about interface
......................................
show interfaces


To display interface line status
................................
show interface status 


To display configuration settings and operational status
........................................................
show interfaces switchport 



To see if CDP is enabled
........................
show cdp


To list summary of each neighbor connected
..........................................
show cdp neighbors[detail]


To list every VLAN and its assigned interface
.............................................
show vlan
show vlan brief


To display information about security configured on the interface>
.................................................................
show port security [interface interface-id] 
				
			

Inter VLAN Routing by Layer 3 Switch

				
					Creating VLANs on layer 3 switches namely VLAN 2 on the 
switch ports fa0/1, 2 and fa0/3, 4 for VLAN 3.
........................................................
Switch# vlan 2
Switch# vlan 3
Switch# int range fa0/1-2
Switch# switchport access vlan 2
Switch# int range fa0/3-4
Switch# switchport access vlan 3


Creating SVI for VLAN 2 giving it IP address 192.168.1.1/24 and SVI for 
VLAN 3 giving IP address 192.168.2.1/24 
.......................................................................

Switch# ip routing
Switch# int vlan 2
Switch# ip address 192.168.1.1 255.255.255.0
Switch# int vlan 3
Switch# ip address 192.168.2.1 255.255.255.0


				
			

Intervlan Routing Configuration For Router

				
					Router Connect to L2 Switch This Diagram
.........................................
config t
interface fa0/0.10  <VLAN ID 10 Subinterfaces >
encapsulation dot1q 10
ip address 10.10.10.1 255.255.255.0
no shutdown
exit

config t
interface fa0/0.20
encapsulation dot1q 20
ip address 10.10.20.1 255.255.255.0
no shutdown
exit

config t
interface fa0/0.30
encapsulation dot1q 30
ip address 10.10.30.1 255.255.255.0
no shutdown
exit
				
			

Connect Cisco Router & Switch to Internet

Cisco switches and routers are vital components of the network architecture. Switches are responsible for transferring data within a LAN, while routers are responsible for transferring data between different networks. Configuring these devices is one of the key steps in building a stable and efficient network

				
					Router Interface Configuration
..............................

show ip interface breif
config t
interface fa0/0
ip address dhcp
no shutdown
exit


Default Routing Configuration
............................

config t
ip route 0.0.0.0 0.0.0.0 192.168.1.1
				
			
				
					Intervlan Routing Configuration For Router
.........................................

config t
interface fa0/0.10  <VLAN ID 10 Subinterfaces >
encapsulation dot1q 10
ip address 10.10.10.1 255.255.255.0
no shutdown
exit

config t
interface fa0/0.20
encapsulation dot1q 20
ip address 10.10.20.1 255.255.255.0
no shutdown
exit

config t
interface fa0/0.30
encapsulation dot1q 30
ip address 10.10.30.1 255.255.255.0
no shutdown
exit
				
			
				
					DHCP Server Configuration For Router
...................................

config t
ip dhcp pool 10 <For VLAN 10>
network 10.10.10.0 255.255.255.0
default router 10.10.10.1
dns-server 8.8.8.8
exit

config t
ip dhcp pool 20
network 10.10.20.0 255.255.255.0
default router 10.10.20.1
dns-server 8.8.8.8
exit

config t
ip dhcp pool 30
network 10.10.30.0 255.255.255.0
default router 10.10.30.1
dns-server 8.8.8.8
exit
				
			
				
					NAT Configuration For Router
............................

config t
interface fa0/1 <WAN Interface Outside>
ip nat outside
exit


interface fa0/0.10 <Inside LAN Subinterfaces>
ip nat inside
exit

interface fa0/0.20
ip nat inside
exit


interface fa0/0.30
ip nat inside
exit


ACL Configuration
.................

ip access-list standard local
permit 10.10.10.0 0.0.0.255
permit 10.10.20.0 0.0.0.255
permit 10.10.30.0 0.0.0.255
exit

ip nat inside source list local interfaces fa0/1 overload




Switch Configuartion For Trunking Multiple VLAN TAG Carry
.........................................................
config t
interface gig/48
switchport mode trunk
no shutdown

show interface trunk


VLAN Configuration For Switch
............................

Create VLAN 
config t
vlan 10
name HR
no shut
exit


vlan 20
name IT
no shut
exit

vlan 30
name Sales
no shut
exit

show vlan



Assign Port For VLAN
....................

interface range 0/1-16
switchport mode acces
switchport access vlan 10

interface range 0/17-20
switchport mode acces
switchport access vlan 20

interface range 0/21-25
switchport mode acces
switchport access vlan 30

[All Configuration Done]
				
			

Telnet & SSH & Basic Configuration

				
					Configuring Enable Mode Password Router 
....................................
enable password 123 
enable secret cisco 


Router & Switch  Usermode Password Protected
............................................
line console 0
password 123
login
exit
service password-encryption <MD5 Encrption



Configuring Telnet Authentication Router & Switch
...............................................
line vty 0 4 
password cisco 
login 



Configuring Local Telnet Authentication Router & Switch
...................................................
username admin password cisco 
line vty 0 4 
login local 



Configuring SSH Authentication Router And Switch
.............................................
username ali password 123 
ip domain-name ksa.com 
crypto key generate RSA 
line vty 0 4 
login local 
transport input ssh 

SSH Access Any PC CMD Commnd
............................
ssh -l ali 192.168.1.1


Telnet Access Any PC CMD Commnd
...............................
telnet 192.168.1.1


Password Encryption Router & Switch
................................
service password-encryption 
enable password cisco 
no service password-encryption 


Login Banner Router & Switch
..........................
banner login $ Login Message $ 
banner motd & Message here & 


				
			

VTP Configuration

				
					Switch1
.......
vtp mode server
vtp domain saikat
vtp password cisco



Switch2
.......
vtp mode client 
vtp domain saikat
vtp password cisco


Switch3
.......
vtp mode client 
vtp domain saikat
vtp password cisco



Switch#show vtp status
VTP Version                     : 2
Configuration Revision          : 3
Maximum VLANs supported locally : 255
Number of existing VLANs        : 7
VTP Operating Mode              : Client
VTP Domain Name                 : study-ccna
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x82 0xA7 0xF2 0x89 0x5F 0xC3 0x98 0x52 
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00


Vtp Transparent Configure
.........................
vtp mode transparent
				
			

How To Backup Switch Configuration

				
					
Switch Factory Reset
....................
erase startup-config

show version
show flash
copy running-config tftp:
copy tftp: startup-config

Switch Configuration Backup
...........................

copy runnig-config tftp:
Address remote host 192.168.1.100
Destination filename enter

Switch Configuration Restore
............................

copy tftp: runnig config
Address remote host 192.168.1.100
Source filename Itindex-confg
Destination filename enter