Cisco 指令 Part.1

Basic knowledge


Autocomplete: <TAB>

Switch#show ru<TAB>
Switch#show running-config

List Available Commands: ?

Switch#show r?
radius          redundancy  region     registry
reload          rep         resource   rhosts
rib             rif         rmon       rom-monitor
romvar          route-map   route-tag  rpl

Interface Name and abbreviation

  • FastEthernet0/1 or Fa0/1
  • GigabitEthernet1/0/2 or Gi1/0/2
  • TenGigabitEthernet1/0/3 or Te1/0/3
  • Port-channel1 or Po1
  • Vlan543 or Vl543​

Command Line Modes

User Mode


Privileged Mode


Configuration Mode

Switch#configure terminal



  • show running-config : running configuration
  • show interfaces : detail of all interfaces
  • show interfaces Fa0/1 : detail of a specified interface
  • show interfaces status : interface status
  • show vlan : VLANs in VLAN database
  • show mac address-table : MAC address/port mapping
  • show arp : ARP table
  • show version : hardware/software infomation
  • show ?

Output Modifier

<command> | include <expr>   // output lines that include <expr>
<command> | exclude <expr>   // output lines without <expr>
<command> | begin <expr>     // output begins from the first line that includes <expr>
// spaces around "|" cannot be omitted!
Switch#show arp | include
Internet  102  98f2.b3ee.bb4e  ARPA  Vlan30

Save Configuration # important

Switch#copy running-config startup-config
Switch#write memory

Global Configurations

set hostname

Switch(config)#hostname <name>

Cancel config

Switch(config)#no <command>

configuring passwords

enable password

Cisco IOS Security Configuration Guide, Release 12.2

CiscoLab(config)#enable secret CISCO
CiscoLab#show running-config
enable secret 5 $1$mERr$NJdjwh5wX8Ia/X8aC4RIu.

connection password

分為本地端連線 (console) 和 遠端終端連線 (vty)

Switch(config)#line console 0  // 設定本地介面編號 0
Switch(config)#line vty 0 4    // 設定終端介面編號 0~4

Switch(config-line)#password cisco

啟用 password-encryption ( 其實是 encode )

Switch(config)#service password-encryption

CiscoLab#show running-config
line vty 0 4
password 7 0822455D0A16

Interface Configurations

choose interface

Switch(config)#interface FastEthernet0/1

set port access VLAN

Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 543

set port as a trunk port

Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 543,544

set switch IP on VLAN interfaces

Switch(config-if)#ip address

set channel group

Switch(config-if)#channel-group 1 mode active


Leave a Reply

Your email address will not be published. Required fields are marked *