Router/Switch 進入特權模式
Switch or Router> enable
Router/Switch 進入設定模式
Switch or Router# config terminal (簡化:cont t)
Switch or Router(config)#
設定 Switch/Route 密碼
進入特權模式密碼:
Switch or Router(config)# enable password yourpassword
連線密碼:
Switch or Router(config)# line console 0
Switch or Router(config-line)# password yourpassword
Switch or Router(config-line)# login
Switch or Router(config-line)# line vty 0 15
Switch or Router(config-line)# password yourpassword
Switch or Router(config-line)# login
Switch or Router(config-line)# exit
上述密碼加密
Switch or Router(config)# service password-encryption
Switch or Router(config)#
設定設備介面 (Interface / VLAN)
Router 設定 Module 0 的第一個 Interface Port,賦予 Interface IP 位址,啟動 Interface,啟動後顯示狀態資訊。
Router(config)# int g0/0
Router(config-if)# ip address 192.168.1.254 255.255.255.0
Router(config-if)# no shutdown (可簡化:no shut)
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
Router(config-if)#
Switch 設定 vlan1 的 IP 位址,啟動 vlan1,即啟動後狀態
Switch(config)# interface valn 1
Switch(config-if)# ip address 192.168.1.1 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up
Switch(config-if)#
將上述編輯資料寫入 IOS 設定檔
Switch# write
or
Switch# copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Switch#