CISCO Switch Commands

From KlavoWiki
Revision as of 07:20, 10 February 2017 by David (talk | contribs) (→‎Factory Reset)
Jump to navigationJump to search

Factory Reset

enable
erase startup-config

or

enable
write erase

Switch IP Address

Default IP

enable
configure terminal
!
interface vlan 1
ip address 192.168.1.111 255.255.255.0
no shutdown
exit

Default Gateway

enable
configure terminal
!
ip default-gateway 192.168.1.254
exit

Default Name Servers

enable
configure terminal
!
ip default-name 8.8.8.8
exit


Interfaces

Show

show interface FastEthernet 0/1
!
show ip interface brief

VLAN's

Creation

There are two type of VLANs. Interface and non Interface. Interface VLANs mean the switch can pass traffic between VLANs otherwise a router will be required.

enable
configure terminal
!
vlan 10
name Corporate
!
vlan 20
name Test
exit

VLAN IP

enable
configure terminal
!
interface vlan 10
ip address 192.168.11.100 255.255.255.0
no shutdown
!
interface vlan 20
ip address 192.168.15.100 255.255.255.0
no shutdown
exit

Ports

enable
configure terminal
!
interface fa0/1
switchport mode access
siwthcport access vlan 10
exit
interface fa0/2
switchport mode access
siwthcport access vlan 20
exit
interface fa0/3
switchport mode access
siwthcport access vlan 30
exit
!
interface range fa0/10-20
switchport mode access
siwthcport access vlan 20
exit
!
interface range fa0/21-24
switchport mode access
siwthcport access vlan 30
exit

Multiple VLAN on Single Interface

enable
configure terminal
!
vlan 10
name Corporate
exit
vlan 20
name Wireless
exit
vlan 30
name Test
exit
!
interface gigabitEthernet 0/0
no shutdown
!
interface gi0/0.10
encapsulation dot1Q 10
ip address 192.168.1.254 255.255.255.0
!
interface gi0/0.20
encapsulation dot1Q 20
ip address 192.168.2.254 255.255.255.0
!
interface gi0/0.30
encapsulation dot1Q 30
ip address 192.168.3.254 255.255.255.0
!
exit

Trunk Port

enable
configure terminal
!
interface FastEthernet 0/1
switchport mode trunk
exit

VLAN's Show

show vlan brief
!
show vlan id 10
!
show vlan id 20
!
exit

Disable DNS Lookups

If you accidentally type in a command the is not recognised the switch will try to do a DNS lookup. To disable this.

enable
configure terminal
!
no ip domain lookup
exit

CDP (CISCO Discovery Protocol)

Enable

enable
configure terminal
!
cdp run

Disable

enable
configure terminal
!
no cdp run

Show Neighbours

show cdp neighbours
!
show cdp entry NAME