Cisco

Cisco 指令

設定Switch名稱
hostname {主機名稱}

 

啟用特權、設定模式
en
#or
enable
configure terminal
設定連線方式
ip ssh version 2         #使用ssh v2協定
line vty 0 6             #開啟0~6vty連線(即最大連線人數7人)
transport input ssh      #啟用ssh
transport input telnet   #啟用telnet
transport input all      #ssh.telnet均啟用
transport input none     #ssh.telnet均關閉
新增使用者
username user password pw #使用明碼的方式建立
username user secret pw   #使用加密的方式建立

備註:nopassword:不使用密碼。
        nosecret:取消加密。

修改使用者密碼
 username 帳號 privilege 15 secret 新密碼
將設定複製到啟動參數
copy running-config startup-config

圖片.png

備註:因為修改設定時會對現行運作的參數做修改,所以如果沒有進行複製的話重開機增加的設定都會不見。
        出現Destination filename (startup-config)?時直接按Enter就可以了M,不要跟我一樣按Y XD。

備份指令(使用tftp傳遞)
copy running-config tftp

備註:下完指令後需要輸入server host跟需不需要改檔案名稱。

啟用或取消特權密碼
enable password 密碼
enable secret 密碼

no enable password
no enable secret
顯示指令

顯示運行中設定

show running-config

備註:顯示啟用參數改成startup-config

擷取要顯示的資訊

#會顯示跟user有關的資訊
show run | i user

顯示版本

show version
Console相關

設定console密碼

line console 0
password {密碼}
login
exec-timeout 0
logging synchronus
介面設定

選擇要設定的介面

int {要設定的介面}
description {要加入的備註}

設定單雙工與速度

duplex auto
#設定全雙工

speed auto
#設定速度

啟動介面(在config模式)

int {介面}
no shutdown
Vlan設定

顯示現在vlan狀況

show vlan

進入configure進行設定

configure terminal

設定介面

interface {介面}
#設定單個介面

interface range {介面range}
#設定多個介面

開始設定vlan

switchport mode access
#開始設定vlan

switchport access vlan {ID}
#也可以設定none取消Vlan
exit