LMS知識社群各系上網率圖資處首頁登入
CCNA 指令筆記
by 洪瑞展 2017-01-16 17:33:02, 回應(0), 人氣(5715)
Router 設定

進入特權模式   enable 
退出           disable 
全域設定模式 (需在特權後 )  configure terminal

router# show startup-config   ( 通常我們會放在 NV RAM ,這樣子重開機才不會不見,執行中的設定都會在 RAM) 
router# show running-config   ( 看目前正在執行的 設定檔 ,在 RAM 中的 )

?  ( 列出所有的指令 )

5.3.4 練習

router(config)# hostname [名字]   (指定 Router 的名字 ) 
router(config)# enable password [密碼]  (指定進入 特權模式 所需要的密碼 )

router(config)# enable secret [密碼]  (指定進入

router# copy run start  (將目前已設定好的內容,儲檔至 NV Ram)

用 Console 連到 router 的 密碼設定 ( 比 enable 還早 ) 
router(config)# line console 0 (指某一個 console ) 
router(config-line)# password [密碼] 
router(config-line)# login            (這個一定要!不然會錯 )

虛擬終端機密碼 
router(config)# line vty 0 4 ( 這是指 0 到 4 個 一共五個連線進來) 
router(config-line)# password [密碼] 
router(config-line)# login            (這個一定要!不然會錯 )

顯示 Router 的項目  (有六種) 
Router# show  

設定 Serial 
Router(config)# interface serial 0/0    (怎麼知道是這個編碼? 要用 show interface 去查編號 ) 
Router(config-if)# description [註解] 
Router(config-if)# ip address [IP] [255.255.255.0] 
Router(config-if)# clock rate 64000   (速率) or 128000 ( 這個一定要設!而且 2 台對接時只能有一台設,不然會 ping 不通 ) 
Router(config-if)# no shutdown

預設 路由 ( 當不知道的 ip 時就往上丟 ) 
Router(config)# ip route 0.0.0.0 0.0.0.0 [另外一台的 router IP] 
or 
Router(config)# ip route 0.0.0.0 0.0.0.0 [自已的介面編號]

進入 DHCP 模式  (5.3.7) 
Router(config)# ip dhcp pool Lan-address  (進入 DHCP 模式) 
Router(dhcp-config)# network 10.1.1.1 255.255.255.0 
Router(config)# ip dhcp excluded-address 10.1.1.1 10.1.1.100  (從 1 到 100 不會發出去 )

Router(dhcp-config)# domain-name demo.com              (指定網域名稱) 
Router(dhcp-config)# dns server 10.1.1.1   (指定 DNS) 
Router(dhcp-config)# default-router 10.1.1.1 
Router# show running-config

NAT  將內外部的 ip 進行轉換 
Router(config)# interface [自已的介面編號]  (對內的卡) 
Router(config-if)# ip nat inside

Router(config)# interface [自已的介面編號]  (對外的卡 
Router(config-if)# ip nat outside

Router(config)# ip nat inside source static 10.1.1.1 10.1.1.1

Cisco 路由器設定備份到 TFTP 上

  Router# copy startup-config tftp   (備份) 
  接下來就指定 tftp 的ip or name

  Router# copy running-config tftp 
  接下來就指定 tftp 的ip  or name

  Router# copy tftp startup-config  (還原)  
  接下來就指定 tftp 的ip  or name

***************************************** 
第五章!重要 
*****************************************

交換器一開啟就會執行供電自檢 (POST) LED 會閃

為什麼要 給 switch 是因為可以做 ping 的檢查! ( 若沒有的話!就沒辦法測 )

設定 交換器 5.4.3 
Switch# show run   -- 顯示所有的設定

Switch(config)#  hostname [xxx]    ( 改名稱 ) 
Switch(config)#  interface vlan 1                ( 預設  透過虛擬的方式 來給 交換器 ip  ( 因為本身沒辦法給 ip ) 
Switch(config-ip)# ip address [ip] [255.255.255.0]    ( 設定 IP ) 
Switch(config-ip)# no shutdown 
Switch(config-ip)# exit

Switch(config)# ip default-gateway [IP]        ( 這是全域的  ) 
Switch(config)# end 
Switch(config)# copy run start

Switch# show interface vlan 1        ( 顯示特定介面的內容 )

***************************************** 
第六章!重要 
*****************************************

Router# show ip route   ( 顯示 路由表 )   
    ex.. c 10.1.1.1/24 [權重] [介面] [到達目的地的次數] 
        c 代表這台路由直接連結的網段  
        s 代表「靜態設定」 
        r 代表 「動態更新的」(透過 RIP )

預設 路由 ( 當不知道的 ip 時就往上丟 ) 
Router(config)# ip route 0.0.0.0 0.0.0.0 [另外一台的 router IP]     (只要不認識就往那台丟 )

靜態 路由 
Router(config)# ip route 10.1.1.1 255.255.255.0 [另外一台的 router IP]  (這個的 ip 可以是很遠的網段 )

動態路由演算法

==== 距離向量路由演算法 (局部)======================================

RIP = 路由資訊協定 Route Infomation Potocal (屬於 「距離向量」) v1 只會傳 IP , v2多了遮罩

EIGRP =  (Cisco 設備專用的 ) 採用 「擴散更新演算法 ( DUAL )」 
         還會記錄 「鄰居 Router」和「拓撲圖」

===== 鍵路狀態路由 Link (全部) =========================================

會用網路整個的拓撲圖 來去計算最短路徑 
1. 路由表 
2. 鍵路狀態通告 (LSA) 說明每條線是否能連線 
3. 拓撲資料庫         負責存 LSA 
4. 最短路徑優先 (SPF 樹)

==============================================

設定 RIP   6.1.5

Router(config)# router rip 
Router(config-router)# version 2 (這是無級別) 
Router(config-router)# network 192.168.1.0  ( 輸入自已認得的網段 *N ) 
Router(config-router)# network 自已的 IP    ( 跟別人講自已是誰 ) 
Router(config)# exit

驗證 rip 
Router# show ip route   ( 顯示 路由表 )  

Router# show ip protocols  ( 列出所有 設定 包含 rip  )

Router# debug ip rip


===================================

Port channel

switch1>en
switch1#conf t
switch1(config)#int range fa 0/1-2
switch1(config-if-range)#channel-group 1 mode on

switch2>en
switch2#conf t
switch2(config)#int range fa 0/1-2
switch2(config-if-range)#channel-group 1 mode on


標籤: CCNA, Cisco