Friday, 3 May 2013

CCNA COMMAND


Command
descriptions

switch>?
The ? works here the same as in a router Used to get the list of all available commands

switch>enable
User mode, same as a router

switch#
Privileged mode

switch#disable
Leaves privileged mode

switch>exit
Leaves user mode

switch#show version
Displays information about software and hardware.

switch#show flash:
Displays information about flash memory (will work only for the 2900/2950 series).

switch#show mac-address-table
Displays the current MAC address forwarding table
.

switch#show running-config
Displays the current configuration in DRAM.

switch#show startup-config
Displays the current configuration in NVRAM.

switch#show vlan
Displays the current VLAN configuration.

switch#show interfaces
Displays the interface configuration and status of line: up/up, up/down, admin down.

switch#show interface vlan1
Displays setting of virtual interface VLAN 1, the default VLAN on the switch.

To Reset Switch Configuration

Switch#delete flash:vlan.dat
Removes the VLAN database from flash memory.

Delete filename [vlan.dat]?
Press Enter

Delete flash:vlan.dat? [confirm]
Press Enter

Switch#erase startup-config
Erases the file from NVRAM.

Switch#reload
Restarts the switch.

To Set Host Names

Switch#configure terminal
Moves to global configuration mode

Switch(config)#hostname Switch1
Creates a locally significant host name of the switch. This is the same command as the router.

Switch1(config)#


To Set Passwords

Switch(config)#enable password vinita
Sets the enable password to vinita

Switch(config)#enable secret nikki
Sets the encrypted secret password to nikki

Switch(config)#line console 0
Enters line console mode

Switch(config-line)#login
Enables password checking

Switch(config-line)#password vinita
Sets the password to vinita

Switch(config-line)#exit
Exits line console mode

Switch(config-line)#line vty 0 4
Enters line vty mode for all five virtual ports

Switch(config-line)#login
Enables password checking

Switch(config-line)#password vinita
Sets the password to vinita

Switch(config-line)#exit
Exits line vty mode

Switch(config)#


To Set IP Addresses and Default Gateways

Switch(config)#interface vlan1
Enters the virtual interface for VLAN 1, the default VLAN on the switch

Switch(config-if)#ip address 192.168.0.10 255.255.255.0
Sets the IP address and netmask to allow for remote access to the switch

Switch(config-if)#exit


Switch(config)#ip default-gateway 192.168.0.5
Allows IP information an exit past the local network

To Set Interface Descriptions

Switch(config)#interface fastethernet 0/1
Enters interface configuration mode

Switch(config-if)#description Finance VLAN
Adds a description of the interface

To Set Duplex Operation

Switch(config)#interface fastethernet 0/1
Moves to interface configuration mode

Switch(config-if)#duplex full
Forces full-duplex operation

Switch(config-if)#duplex auto
Enables auto-duplex config

Switch(config-if)#duplex half
Forces half-duplex operation

To Set Operation Speed

Switch(config)#interface fastethernet 0/1


Switch(config-if)#speed 10
Forces 10-Mbps operation

Switch(config-if)#speed 100
Forces 100-Mbps operation

Switch(config-if)#speed auto
Enables autospeed configuration

MAC Address Table

switch#show mac address-table
Displays current MAC address forwarding table

switch#clear mac address-table
Deletes all entries from current MAC address forwarding table

switch#clear mac address-table dynamic
Deletes only dynamic entries from table

Switch(config)#vlan 10
Creates VLAN 10 and enters VLAN configuration mode for further definitions.
Switch(config-vlan)#name Sales
Assigns a name to the VLAN. The length of the name can be from 1 to 32 characters.
Switch(config-vlan)#exit
Applies changes, increases the revision number by 1, and returns to global configuration mode.
Switch(config)#interface fastethernet 0/1
Moves to interface configuration mode
Switch(config-if)#switchport mode access
Sets the port to access mode
Switch(config-if)#switchport access vlan 10
Assigns this port to VLAN 10
Switch#show vlan
Displays VLAN information
Switch#show vlan brief
Displays VLAN information in brief
Switch#show vlan id 10
Displays information about VLAN 10 only
Switch#show vlan name sales
Displays information about VLAN named sales only
Switch#show interfaces vlan x
Displays interface characteristics for the specified VLAN
Switch#delete flash:vlan.dat
Delete filename [vlan.dat]?
Delete flash:vlan.dat? [confirm]
Switch#
Removes the entire VLAN database from flash.
Make sure there is no space between the colon (:) and the characters vlan.dat. You can potentially erase the entire contents of the flash with this command if the syntax is not correct. Make sure you read the output from the switch. If you need to cancel, press ctrl+c to escape back to privileged mode:
Switch(config)#interface fastethernet 0/5
Moves to interface configuration mode.
Switch(config-if)#no switchport access vlan 5
Removes port from VLAN 5 and reassigns it to VLAN 1—the default VLAN.
Switch(config-if)#exit
Moves to global configuration mode.
Switch(config)#no vlan 5
Removes VLAN 5 from the VLAN database.
Switch#copy running-config startupconfig
Saves the configuration in NVRAM
Switch(config-if) #switchport mode trunk
Puts the interface into permanent trunking mode and negotiates to convert the link into a trunk link.
Switch(config)#vtp mode server
Changes the switch to VTP server mode.
Switch(config)#vtp mode client
Changes the switch to VTP client mode.
Switch(config)#vtp mode transparent
Changes the switch to VTP transparent mode.
Switch(config)#no vtp mode
Returns the switch to the default VTP server mode.
Switch(config)#vtp domain domain-name
Configures the VTP domain name. The name can be from 1 to 32 characters long.
Switch(config)#vtp password password
Configures a VTP password
.
Switch(config)#vtp pruning
Enables VTP pruning
Switch#show vtp status
Displays general information about VTP configuration
Switch#show vtp counters
Displays the VTP counters for the switch






0 comments: