[上課筆記] 架設公司網路 :: Chapter6-CDPandStatic

週一早上結束了考試,接著又來一道題目啦(>"<)o 沒關係,趁剛開始課程還沒這麼難,能加緊練習就多多練習。
題目:-------------------------------------- 一、請設定各網路設備的設備名稱。

二、請開啟以下幾個介面:
2-1 MIS-Router的 s0/0/0、s0/0/1並且設定這些兩個介面的clock rate 為 64000
2-2 MIS-Router的 s0/1/0
2-3 MIS-Router的 fa0/0
2-4 HR-Router的 s0/0/0
2-5 HR-Router的 fa0/0
2-6 HR-Router的 s0/0/0
2-7 HR-Router的 fa0/0

三、請開啟各設備的CDP並觀察各設備的直連設備,觀察MIS-Router連到Internet之連線對方的IP位址。
並關閉各Switch連到PC的port的CDP。

四、請依照圖上的IP指示設定各介面的IP位址。

五、請先確保公司內部網路會通:
5-1請在各設備上使用靜態路由設定公司內部的每一個遠端網路。
5-2使公司內部網路各設備互Ping都會通。

六、請在HR-Router與 ACC-Router上開啟5條VTY連線供telnet連線使用。

七、請在各路由器上視需求設定預設路由。
八、請在各設備上測試,Ping 168.95.1.1是否可以通。
---------------------------------------------------------------------------------------------
這個設計是模擬在公司內有三個部門,最後由mis的router連結到外面的isp業者,在這裡所練習的為靜態路由(static route)接下來所撰寫的程式碼將與上課所學的不同,我們所知每一個router內都有一個router table,其中route所需判斷是目的地位置IP,在如此少量穩定不易更動的環境下所使用靜態網路下,末梢route部分我們可以多加利用default route,也就是說不需要像MIS route那樣判斷很多路線,在末梢部分只要判斷true or false,接下去看指令碼就栽囉。
---------------------------------------------------------------------------------------------
解題:
現在的switch幾乎都自動執行判斷了,只要不是來源網域與目的網域相同者一律網上丟,似乎功能與default

步驟1*先下手最麻煩的吧!
(1) 先幫各router的各個介面設定好IP address與no shutdown,同時先設定好default route;其中注意的是route之間所使用的媒介為DCE,故必須要設定clock rate。
(2) 除此之外還要開啟CDP(cisco discovery protocol為cisco設備官方自訂的功能,具有彼此互相交換資訊,可透過指令#sh cdp neighbors,同時也會產生多餘的封包,故非route的設備介面可以單獨取消)。

-----------MIS router-------------
  • Router>en
  • Router#sh cdp nei //查看CDP狀態
  • % CDP is not enabled
  • Router#config t
  • Router(config)#cdp run //開啟CDP

  • Router(config)#int fa 0/0
  • Router(config-if)#ip address 10.0.0.254 255.255.0.0
  • Router(config-if)#no shutdown
  • Router(config-if)#no cdp enable //排除這裡的CDP
  • Router(config-if)#exit

  • Router(config)#int s0/0/0
  • Router(config-if)#ip address 192.168.1.1 255.255.255.252
  • Router(config-if)#clock rate 64000
  • Router(config-if)#no shutdown
  • Router(config-if)#exit

  • Router(config)#int s0/0/1
  • Router(config-if)#ip address 192.168.2.1 255.255.255.252
  • Router(config-if)#clock rate 64000
  • Router(config-if)#no shutdown
  • Router(config-if)#exit

  • Router(config)#int s0/1/0
  • Router(config-if)#ip address 168.168.168.1 255.255.255.0
  • Router(config-if)#no shutdown
  • Router(config-if)#exit

  • Router(config)#ip route 172.16.0.0 255.255.0.0 s0/0/0
  • Router(config)#ip route 192.168.3.0 255.255.255.0 s0/0/1
  • Router(config)#ip route 0.0.0.0 0.0.0.0 s0/1/0 //此乃default route
  • Router(config)#end

  • %SYS-5-CONFIG_I: Configured from console by console
  • Router#copy run start
  • Destination filename [startup-config]?
  • Building configuration...
  • [OK]
----------HR-Router-----------------------

  • R1>en
  • R1#config t
  • R1(config)#cdp run
  • R1(config)#int s0/0/0
  • R1(config-if)#ip address 192.168.1.2 255.255.255.252
  • R1(config-if)#no shutdown
  • R1(config-if)#exit
  • R1(config)#int fa0/0
  • R1(config-if)#ip address 172.16.0.254 255.255.0.0
  • R1(config-if)#no shutdown
  • R1(config-if)#no cdp enable
  • R1(config-if)#exit
  • R1(config)#ip route 0.0.0.0 0.0.0.0 s0/0/0 //直接打default route,反正route不認識的一定往這送
  • R1(config)#end
  • R1#copy run start
  • Destination filename [startup-config]?
  • Building configuration...
  • [OK]
-------------ACC Router----------------

  • R2>en
  • R2#config t
  • R2(config)#cdp run
  • R2(config)#int s0/0/0
  • R2(config-if)#ip address 192.168.2.2 255.255.255.252
  • R2(config-if)#no shutdown
  • R2(config-if)#exit
  • R2(config)#int fa 0/0
  • R2(config-if)#ip address 192.168.3.254 255.255.255.0
  • R2(config-if)#no shutdown
  • R2(config-if)#no cdp enable
  • R2(config-if)#exit
  • R2(config)#ip route 0.0.0.0
  • R2(config)#ip route 0.0.0.0 0.0.0.0 s0/0/0
  • R2(config)#end
  • R2#copy run start
  • Destination filename [startup-config]?
  • Building configuration...
  • [OK]
-----------------------------------------------
步驟2*e04手好酸,跟笨蛋一樣上課寫過一遍回家又寫一遍。接著是設定各PC的IP請直接對照圖進行設定即可。不過似乎已經幫你寫好了,手可以省點力氣。接著試試ping看看三台電腦與遠端ISP。

嗯嗯,都成功,很好下班~
...
問我怎check results錯很多?這位客官是這樣的,首先switch並沒有設定ip,switch是很自動的東西,會自己送,而給他一個ip是為了以後方便遠端控制,switch ip設定與router ip設定是差不多的;其次是指令碼寫法不同,與題目的標準答案不一樣,同時標準答案也沒有獨立的。故因此為何老師強調以後不再使用check results。

留言