1. 程式人生 > >思科CCIE總結:路由器、交換機

思科CCIE總結:路由器、交換機

bbs.spoto.net/forum-178-1.html   -----雛鷹部落


GNS3安裝

1、安裝的所有目錄不能使用中文

ISO如何操作

securecrt如何使用建立會話:之前總是連不上的原因是沒有選 telnet協議,而不是ssh協議,要注意。


cmd如何進入GNS3模式:telnet localhost 2001


GNS3使用過程以及兩個路由怎樣連線

開啟軟體--新增映象(c3640-jk9o3s-mz.124-13a)--計算IDLE值直到出現*號選擇即可,目的是降低cpu使用率在10%以下才可以--暫停雙擊--新增快速乙太網口--add a link--兩個路由連線起來

命令
+?=檢視幫助 使用者模式:》 輸入exit 可以退出 特權模式:# 輸入enable進入特權模式 全域性模式(router(config)#模式--更高一級):輸入configure terminal特權模式 全域性模式退出:end 到上一級,exit 到使用者模式 pc4(config)#default interface f 0/0 ------還原預設配置 配置console密碼,下次再插console就得輸入密碼 R1(config)#line console 0 ---進入介面 R1(config)#password spoto R1(config-line)#login
當其他裝置連線這臺裝置時需要密碼驗證 R1(config-line)#no login R1(config-line)#no pas spoto 使用者模式-特權模式 設定密碼 到特權模式下 R1(config)#enable secret spoto VTY口令-用於限制人員通過telnet訪問裝置,裝置第一次現場除錯,以後要通過遠端telnet除錯, 實驗: R1作為被除錯的裝置,R2去登陸R1除錯 R1(config)#line vty 0 4 vty:虛擬通道 0-4:要開5個通道 R1(config-line)#password spototelnet R1#
sh ip int R1#sh ip int b R1#conf t R1(config)#int f 0/0 R1(config-if)#ip add 1.1.1.1 255.255.255.0 R1(config-if)#no sh R1(config-if)#no shutdown R2(config)#int f 0/0 R2(config-if)#ip add 1.1.1.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#no shutdown R1(config-if)#ping 1.1.1.2 ---------這個模式報錯--Ping測試要在特權模式下 ^ % Invalid input detected at '^' marker R1#ping 1.1.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 1.1.1.2, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 16/44/88 ms R2#telnet 1.1.1.1 -------------注意是特權模式下 Trying 1.1.1.1 ... Open User Access Verification Password: % Password: timeout expired! Password: spototelnet R1>enable Password:spoto R1# 檢視當前所有配置 R1#show running-config ---注意在特權模式下 --儲存在記憶體裡面 即RAM裡面,重啟後會清空 start-up-config 儲存在NVRA裡面 現在裝置都放在flash裡面 儲存在這裡面--再重啟不丟失 儲存配置 第一種 R1#write Building configuration... [OK] 儲存配置 第二種 R1#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] 清空配置 R1#erase startup-config 針對舊裝置, 都對當前配置沒有影響,重啟後才生效 R1#delete flash:config.text 現在裝置 都對當前配置沒有影響,重啟後才生效 配IP步驟: 先進入:使用者模式-》特權模式-》全域性模式-》進入介面 介面區分:如果一臺裝置有兩個插槽,第一個插槽編號是0,第二個插槽編號是1。第一個插槽裡面只有一個介面編號是0;第二個插槽裡面有兩個介面編號,一個是0,一個是1, 一、配置乙太網介面(就是乙太網鏈路)--基於8.2.3標準走,用的ARP協議 進入普通10M乙太網口 interface ethernet 0/0 -----進入第一個插槽編號,第0個介面 interface ethernet 1/0 -----進入第二個插槽編號,第0個介面 interface ethernet 1/1 -----進入第二個插槽編號,第1個介面 ethernet 0/0 第一個0表示10M 整個意思:10M乙太網口 進入快速乙太網口 interface fast-ethernet 0/0 新增ip R1(config-if)#ip add 1.1.1.1 255.255.255.0 啟用介面--------思科裝置預設是關閉的 R1(config-if)#no shutdown 實驗: R1#conf terminal R1(config)#interface fastEthernet 0/0 R1(config-if)#ip address 192.168.1.1 255.255.255.0 -----提示符已變成 -if R1(config-if)#no shutdown R1(config-if)#end R1# R2#configure terminal R2(config)#interface f 0/0 interface s 0/0 R2(config-if)#ip address 192.168.1.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#end R2# Ping測試要在特權模式下 R1#ping 192.168.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: .!!!! ------5個包,第一個包超時 Success rate is 80 percent (4/5), round-trip min/avg/max = 28/45/88 ms R1#ping 192.168.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/71/136 ms 二、配置serial介面(就是序列介面) (就是序列鏈路)(廣域網鏈路) DCE端 R1(config)#interface serial 0/0 R1(config-if)#ip address 192.168.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config)#clock rate 6400 在DCE端配置時鐘訊號。時鐘訊號在運營商,使用者是DTE端,線纜兩頭分別寫著DCE和DTE,做模擬實驗,需要一端模擬運營商, DTE端不用配時鐘 R1(config)#interface serial 0/0 R1(config-if)#ip address 192.168.1.2 255.255.255.0 R1(config-if)#no shutdown 檢視具體介面配置資訊 R1#show interfaces f0/0 ----------注意模式 FastEthernet0/0 is up, line protocol is up ----物理介面和協議都是up Hardware is AmdFE, address is cc00.0b00.0000 (bia cc00.0b00.0000) ---快速乙太網口和MAC地 Internet address is 192.168.1.1/24 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, BW-頻寬是100M, DLY--延遲 reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set R1#show ip int brief ------檢視哪些介面配了哪些ip Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.1 YES manual up up YES manual up---------是物理狀態,如果連線路由器的線斷了就是down了, Protocol up---------是協議狀態,如果沒有配置時鐘訊號,就是down 路由選擇原理;靜態路由(S),直連路由(C) R1#show ip route C 192.168.1.0/24 is directly connected, FastEthernet0/0 C:表示通過什麼渠道獲得,比如手工配置,C是直連,。S是手工配置的靜態的 192.168.1.0/24 :表示目標地址 FastEthernet0/0 :表示從哪出去,從接口出去還是嚇一跳扔給誰。 直連路由:路由介面配完IP後,介面啟用,且雙up:物理和協議都up,就會學習到緊鄰路由的網路號,如:192.168.2.0/24, ---C 靜態路由:人工建表,指定去哪個網段,如果去的網段號很多,就得配好多表,--適合中小型網路。 動態路由:兩個路由之間相互對話,從而學到遠端路由所知道的,比如3.04.06.0等網段。 直連路由的獲取:兩端路由只能知道一側的路由,中間的路由可以知道緊鄰兩側的路由資訊。 靜態路由配置: PC->閘道器->目的路由->目的路由後面是公網 需要人工配置告訴閘道器去往目的地的路由資訊,即網路號 靜態路由配置兩種方式 R1(config)#ip route 192.168.1.0 255.255.255.255.0 192.168.12.1 192.168.1.0指的是公網IP 192.168.12.1指的是和目的路由器相連的左邊的IP.------叫做扔給對端IP R1(config)#ip route 192.168.1.0 255.255.255.255.0 serial 0 serial 0指的是閘道器緊挨著右邊的介面 --------叫做扔給本地介面。 通訊是雙向的,還需要配置回來的路由資訊,也是這樣的, 實驗: PC-> R1路由->R2路由->R3目的路由->目的路由後面的公網 -( R1路由)-S0/0 192.168.12.1/24 192.168.12.2/24 S0/0-( R2路由)-S0/1 192.16823.2/24 192.168.23.3/24 S0/0-( R3路由) R1(config)#ip route 192.168.23.0 255.255.255.0 192.168.12.2 R3(config)#ip route 192.168.12.0 255.255.255.255.0 serial s0/0 192.168.12.2------叫做扔給對端IP serial s0/0指的是閘道器緊挨著右邊的介面 --------叫做扔給本地介面。 通訊是雙向的,還需要配置回來的路由資訊,也是這樣的, 預設路由 表示符號:S* 實驗(緊接著上面):PC-> R1路由->R2路由--後面接著好多網段IP,有1.02.03.04.0;多個隔離網路 R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2 192.168.12.2相當於預設閘道器。 telnet七層訪問構造 客戶 A---閘道器路由---遠端路由---客戶 B 源埠是一個隨機埠,目的埠一定是23埠。 osi七層:7-5層不重要,4層把埠號封裝TCP頭部,然後建立三次握手連線在四層,源埠是一個隨機埠,目的埠一定是23埠;3層報頭加IP,源IP和目的IP;2層是幀頭,加上源mac和目標閘道器路由mac地址(mac只能在本地LAN有效)。A要把資料發給B,必須得先發給閘道器,所以必須得知道閘道器的mac地址。 A通過地址解析協議傳送廣播給閘道器,閘道器收到後再回一個給A,A就會更新它的mac表,然後加上源mac和目標閘道器路由mac地址,最後變成10100的字樣傳給閘道器路由,閘道器收到後拆到第三層漏出IP,如果發現不是給自己的,就原封不動的打包回去,但是他要幫客戶送出去,但是查了查路由沒有到遠端的路由表,所以我們就配置靜態路由的方法告訴他怎麼走。到遠端路由後要拆封到幀,填上自己的mac地址和客戶B的mac地址,所以也要廣播得到,然後送給B計算機,B也要一層層拆,拆到應用層,看是23埠號,是telnet程式,所以就丟給了telnet程式處理。 同理B回包的時候也得走這個過程。 cmd裡面輸入 :arp -a 得到所有的mac地址。 lookback介面是虛擬介面,是個軟體介面跟物理介面一樣,可以配置IP地址。當物理介面不夠用時,就可以用lookback介面。所以要開啟這個、 靜態路由壞處:當有好多個路由時,基本每個路由都要配路由表,會很忙,而且有一個遠端路由壞掉時 ,也不是道。 動態路由協議 --------動態的更新,是一個對話。 靜態路由壞處:當有好多個路由時,基本每個路由都要配路由表,會很忙,而且有一個遠端路由壞掉時 ,也不是道。 動態路由壞處:需要佔用一定的cpu等資源,會佔用一定頻寬,但對網路不會造成太大影響 動網路由協議分類:內部閘道器協議和外部閘道器協議。 AS號:自治系統,-自我管理 AS號內部---------選擇內部閘道器協議 不同AS之間---------選擇外部閘道器協議--------比如兩個跨國公司之間,---比如兩個農業銀行之間 內部閘道器協議包括:1、距離向量協議 2、鏈路狀態協議 外部閘道器協議包括:BGP--適用於超大型網路 距離向量協議 距離向量協議包括:1、RIPV1和RIPV2 2、EIGRP 距離指的跳數--hop 一跳要跨越一臺路由器,比如 R1要通過 R2 跨越2.0網段,這就是垮了一跳,以條數衡量一條路由的好壞, 向量:R2要通告給R1,R1要經過R2,這就是方向 一旦兩臺路由之間執行協議,路由就會更新自己的路由表,進行對話,週期性的更新, 更新方式:採用廣播, 缺點:對鏈路和裝置造成損耗, 收斂完成的意思:動態路由學習完畢 收斂分兩步:1、初次路由資訊交換,進一步交歡 度量值(Metric):衡量一條路由的好和壞 ----附圖見網盤--動態路由--距離向量路由協議。就是說路由 --------前提在同一協議中做比較A連線了兩個分支路由。 -A-B-E-1.0 ---------A到1.0經過了2跳 --------更憂 來源-RIP,網路號,viaB -A-C-D-E-1.0 --------A到1.0經過了3跳 這樣以後都會走更憂的路徑,但是當2跳的任何地方出了問題,就會選擇3跳的路徑 度量值(Metric):同一臺路由器收到多條去往同一個目的地的路由,會比較Metric值,Metric值憂的會被裝進路由表,注:Metric值有比較條數的,有比較頻寬的。如果兩個Metric都相同就會同時使用,這就是負載均衡, RIP缺點:當3跳的那條鏈路頻寬比2跳的那條鏈路頻寬大時,就是浪費,---附圖見網盤--動態路由--距離向量路由協議 冗餘:自動切換鏈路,當有一個鏈路掛掉時候,而靜態的路由是無法自動切換的。 檢視度量值(Metric):show ip route ------附圖見網盤--動態路由--距離向量路由協議 Metric:在同一協議中做比較 管理距離(AD值):指的是不同動態協議之間做比較選擇最優路徑。 總結: 一臺路由器,當它從兩種不同的動態路由協議選擇協議中,學習到去往同一個目的地的路由,比較AD值。取信小的將路由裝入路由表,進行資料轉發,另一條路徑,只有當優選的路徑DOWN掉的時候,才會出現和使用; 一臺路由器,當它從同種動態路由協議,但不同方向(鄰居)學習 去往同一個目的地的路由,則比較metric度量值,選擇憂的,裝入路由表,進行資料轉發。 依照傳聞的更新方式(廣播、更新路由表) -----容易被騙,容易產生環路 逐跳更新 環路的產生:-A-B-C- 當C右端鏈路斷掉時。但是仍然週期性的更新,當有pc訪問C時,C告訴走B,B再告訴走C,往復迴圈,直到跑死,------------附圖見網盤--動態路由--距離矢 還有達到無窮大 量路由協議 消除環路的方法: A-B-C-x 1、定義最大度量值防止計數至無窮大(最大跳數)16 ----這是RIP的最大上限 2、水平分隔 --附圖見網盤--動態路由--距離矢 3、抑制計時器:抑制計時器:遠端出問題時,B和C先啟動計時器。觀察,如果恢復,就繼續使用 4、路由中毒 ---路由無窮大--就是不可達-----泛紅出去------附圖見網盤--動態路由--距離矢 5、毒性逆轉 :帶有路由中毒的水平分隔,:C告訴B路由不可達,B也告訴C我知道路由不可達,並等待C右邊的線路好 6、觸發更新:拓撲傳送變化時,路由立即傳送更新訊息 RIP:適用於金融行業, 基於UDP,埠520的應用層協議。 管理距離120 RIP實驗 R1 R2 R3 如果有多個路由,依次宣告自己的網路號即可 R1#conf t R1(config)#interface S 0/0 R1(config-if)#ip address 192.168.12.1 255.255.255.0 R1(config-if)#no sh R1#ping 192.168.12.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 28/38/52 ms R1#ping 192.168.23.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) R1#conf t R1(config)#router rip R1(config-router)#network 192.168.12.0 R1(config-router)#end R1#sh ip ro Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set C 192.168.12.0/24 is directly connected, Serial0/0 (配置Rip後) R1#ping 192.168.23.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) R2#configure t R2(config)#int s 0/0 R2(config-if)#ip address 192.168.12.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#int s 0/1 R2(config-if)#ip address 192.168.23.2 255.255.255.0 R2(config-if)#no sh R2(config)#end R2#sh ip int b R2#ping 192.168.23.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/35/48 ms R2#conf t R2(config)#router rip R2(config-router)#net R2(config-router)#network 192.168.12.0 R2(config-router)#network 192.168.23.0 R3#conf t R3(config)#int s 0/0 R3(config-if)#ip address 192.168.23.3 255.255.255.0 R3(config-if)#no sh R3(config-if)#end R3#conf t R3(config)#router rip R3(config-router)#network 192.168.23.0 R3(config-router)#end R3#sh ip ro Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set R 192.168.12.0/24 [120/1] via 192.168.23.2, 00:00:22, Serial0/0 C 192.168.23.0/24 is directly connected, Serial0/0 R3#ping 192.168.12.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 56/68/96 ms EIGRP --增強型內部閘道器路由協議 --思科私有---只能在思科裝置上執行--前身是IGRP RFC文件 ----規範 www.rfc 特點:收斂速度比較快,減少頻寬浪費,(觸發性更新)--當網路拓撲傳送變化時才更新, 支援多種網路層協議,(ip,ipx,appletalk) ---見截圖 無類路由:可以識別不同掩碼 高階距離向量協議:不只只是根據跳數,也可以根據頻寬。 100%無環路,---DUAL演算法 首先形成鄰居表,再進行路由資訊同步,然後啟用DUAL演算法,檢視哪個更憂。 三種表:鄰居表,拓撲表。路由表, 通過組播方式泛紅:224.0.0.10傳送 metric計算==頻寬+延遲 =BW+DLY BW=(10的7次方/頻寬 )*256 DLY= ((延遲(微妙)/10)*256 頻寬:沿路所有資料出介面頻寬最低值,且是介面的頻寬,而不是鏈路的頻寬 延遲:沿路所有資料出介面延遲的和 DUAL演算法:提供無環路 後繼路由器:就是選擇metric最優的那條路的下一個路由器。 可行距離:本地到達目標地的metric值,(FD) 本地可以是A 可以是B 可行後繼路由器:備份的那個 (FS) A-B-D- A-C-D- 通告距離:C通告給A到達目的地的D右面網段的距離,(AD) 可行後繼成立的條件:C通告給A到達目的地的D右面網段的距離,(AD)要小於 A通過B到達D右面網段的距離。(FD) 路由更新和資料包的方向是相反的 K值要相等 EIGRP的配置 AS:域,比如一個省份就是一個域,不同的AS用不同的號碼區分, debug:一般不要開啟,開啟後會出現大量除錯資訊,有可能把裝置跑壞, 自動彙總:防止遠端網路號down掉的反覆計算DUAL值協議預設開啟彙總, 10.1.1.0/24 這是個子網 10.網段是A類地址,進行了子網劃分。 172.16.0.0/16 192.168.12.0 是個主類地址, EIGRP的配置實驗 R1#conf t R1(config)#interface S 0/0 R1(config-if)#ip address 192.168.12.1 255.255.255.0 R1(config-if)#no sh R1(config-if)#router eigrp 100 R1(config-router)#network 192.168.12.0 R1(config-router)#end R1#sh ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set C 192.168.12.0/24 is directly connected, Serial0/0 R2#configure t R2(config)#int s 0/0 R2(config-if)#ip address 192.168.12.2 255.255.255.0 R2(config-if)#no sh R2(config-if)# *Mar 1 00:05:13.543: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R2(config-if)# *Mar 1 00:05:14.547: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R2(config-if)#in R2(config-if)#int lo0 R2(config-if)# *Mar 1 00:05:40.851: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up R2(config-if)#ip add 2.2.2.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#no shutdown R2(config-if)#router eigrp 100 R2(config-router)#networ R2(config-router)#network 192.168.12.0 R2(config-router)# *Mar 1 00:06:40.487: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 192.168.12.1 (Serial0/0) is up: new adjacency R2(config-router)#netw R2(config-router)#network 2.2.2. R1#sh ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set C 192.168.12.0/24 is directly connected, Serial0/0 D 2.0.0.0/8 [90/2297856] via 192.168.12.2, 00:00:12, Serial0/0 R1#show ip eigrp neighbors IP-EIGRP neighbors for process 100 H Address Interface Hold Uptime SRTT RTO Q Seq (sec) (ms) Cnt Num 0 192.168.12.2 Se0/0 13 00:02:10 73 438 0 4 R1#show ip eigrp neighbors IP-EIGRP neighbors for process 100 H Address Interface Hold Uptime SRTT RTO Q Seq (sec) (ms) Cnt Num 0 192.168.12.2 Se0/0 14 00:02:33 73 438 0 4 R1#show ip eigrp neighbors IP-EIGRP neighbors for process 100 H Address Interface Hold Uptime SRTT RTO Q Seq (sec) (ms) Cnt Num 0 192.168.12.2 Se0/0 13 00:02:43 73 438 0 4 R1# Connected to Dynamips VM "R1" (ID 13, type c3600) - Console port Press ENTER to get the prompt. R1#sh R1#show ip R1#show ip eifr R1#show ip eigrp R1#show ip eigrp nei R1#show ip eigrp neighbors IP-EIGRP neighbors for process 100 H Address Interface Hold Uptime SRTT RTO Q Seq (sec) (ms) Cnt Num 0 192.168.12.2 Se0/0 13 00:52:02 73 438 0 4 R1#show ip eigrp neighbors IP-EIGRP neighbors for process 100 H Address Interface Hold Uptime SRTT RTO Q Seq (sec) (ms) Cnt Num 0 192.168.12.2 Se0/0 14 00:52:20 73 438 0 4 R1#conf R1#configure t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int s 0/0 R1(config-if)#shu R1(config-if)#shutdown R1(config-if)# *Mar 1 01:05:01.555: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 192.168.12.2 (Serial0/0) is down: interface down R1(config-if)# *Mar 1 01:05:03.515: %LINK-5-CHANGED: Interface Serial0/0, changed state to administratively down *Mar 1 01:05:04.515: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down R1(config-if)#debu R1(config-if)#de R1(config-if)#debu R1(config-if)#debug ip eigr R1(config-if)#end R1#d *Mar 1 01:05:59.195: %SYS-5-CONFIG_I: Configured from console by console R1#deb R1#debug ip eigr R1#debug ip eigrp ? <1-65535> Autonomous System neighbor IP-EIGRP neighbor debugging notifications IP-EIGRP event notifications summary IP-EIGRP summary route processing vrf Select a VPN Routing/Forwarding instance <cr> R1#debug ip eigrp IP-EIGRP Route Events debugging is on R1#conf R1#configure t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int s 0/0 R1(config-if)#no shu R1(config-if)#no shutdown R1(config-if)# *Mar 1 01:08:34.855: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R1(config-if)# *Mar 1 01:08:35.859: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R1(config-if)# *Mar 1 01:08:44.755: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 192.168.12.2 (Serial0/0) is up: new adjacency *Mar 1 01:08:44.915: IP-EIGRP(Default-IP-Routing-Table:100): Processing incoming UPDATE packet *Mar 1 01:08:44.919: IP-EIGRP(Default-IP-Routing-Table:100): 192.168.12.0/24 - do advertise out Serial0/0 *Mar 1 01:08:44.987: IP-EIGRP(Default-IP-Routing-Table:100): Processing incoming UPDATE packet *Mar 1 01:08:44.991: IP-EIGRP(Default-IP-Routing-Table:100): Int 2.0.0.0/8 M 2297856 - 1657856 640000 SM 128256 - 256 128000 *Mar 1 01:08:44.991: IP-EIGRP(Default-IP-Routing-Table:100): route installed for 2.0.0.0 () *Mar 1 01:08:44.995: IP-EIGRP(Default-IP-Routing-Table:100): 192.168.12.0/24 - do advertise out Serial0/0 R1(config-if)# *Mar 1 01:08:45.083: IP-EIGRP(Default-IP-Routing-Table:100): Processing incoming UPDATE packet *Mar 1 01:08:45.087: IP-EIGRP(Default-IP-Routing-Table:100): Int 2.0.0.0/8 M 2297856 - 1657856 640000 SM 128256 - 256 128000 R1(config-if)#end R1#sh *Mar 1 01:11:41.339: %SYS-5-CONFIG_I: Configured from console by console R1#sh ip ro Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set C 192.168.12.0/24 is directly connected, Serial0/0 D 2.0.0.0/8 [90/2297856] via 192.168.12.2, 00:03:01, Serial0/0 R1#un all All possible debugging has been turned off R1#sh ip ro Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set C 192.168.12.0/24 is directly connected, Serial0/0 D 2.0.0.0/8 [90/2297856] via 192.168.12.2, 00:04:33, Serial0/0 ---這個8見截圖, R1#show ip eigrp neigh R1#show ip eigrp neighbors IP-EIGRP neighbors for process 100 H Address Interface Hold Uptime SRTT RTO Q Seq (sec) (ms) Cnt Num 0 192.168.12.2 Se0/0 11 00:41:48 121 726 0 7 R1#ping 192.168.12.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/40/76 ms R1#show ip eigrp topology IP-EIGRP Topology Table for AS(100)/ID(192.168.12.1) Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply, r - reply Status, s - sia Status P 2.0.0.0/8, 1 successors, FD is 2297856 via 192.168.12.2 (2297856/128256), Serial0/0 P 192.168.12.0/24, 1 successors, FD is 2169856 via Connected, Serial0/0 實驗:見截圖 三個路由構成三角形。R3連線一個lookback介面 R1#conf R1#configure t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int f 0/0 ^ % Invalid input detected at '^' marker. R1(config)#int s 0/0 R1(config-if)#ip add 192.168.12.1 255.255.255.0 R1(config-if)#no sh R1(config-if)#no shutdown R1(config-if)# *Mar 1 01:12:39.935: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R1(config-if)# *Mar 1 01:12:40.939: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R1(config-if)#int s 0/1 *Mar 1 01:13:04.195: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down R1(config-if)#int s 0/1 R1(config-if)#ip add 192.168.13.1 255.255.255.0 R1(config-if)#no sh R1(config-if)#no shutdown R1(config-if)# *Mar 1 01:13:41.003: %LINK-3-UPDOWN: Interface Serial0/1, changed state to up R1(config-if)# *Mar 1 01:13:42.007: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up R1(config-if)# *Mar 1 01:14:04.207: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down R1(config-if)#netw R1(config-if)#networ R1(config-if)#network 192.168.12.0 ^ % Invalid input detected at '^' marker. R1(config-if)#rout R1(config-if)#routing i ^ % Invalid input detected at '^' marker. R1(config-if)#routing ei 1 ^ % Invalid input detected at '^' marker. R1(config-if)#route R1(config-if)#router ei 1 R1(config-router)#netw R1(config-router)#network 192.168.12.0 R1(config-router)#network 192.168.13.0 R1(config-router)# *Mar 1 01:22:54.179: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R1(config-router)# *Mar 1 01:23:51.639: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.12.2 (Serial0/0) is up: new adjacency R1(config-router)# *Mar 1 01:26:24.207: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up R1(config-router)# *Mar 1 01:29:43.699: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.13.3 (Serial0/1) is up: new adjacency R1(config-router)#end R2#conf R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#int s 0/0 R2(config-if)#ip add 192.168.12.2 % Incomplete command. R2(config-if)#ip add 192.168.12.2 R2(config-if)#ip add 192.168.12.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#no shutdown R2(config-if)# *Mar 1 01:22:48.531: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R2(config-if)# *Mar 1 01:22:49.535: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R2(config-if)#int s 0/1 R2(config-if)#ip add 192.168.23.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#no shutdown R2(config-if)# *Mar 1 01:23:14.087: %LINK-3-UPDOWN: Interface Serial0/1, changed state to up R2(config-if)# *Mar 1 01:23:15.091: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up R2(config-if)#rout R2(config-if)#router ei 1 R2(config-router)#netw R2(config-router)#network *Mar 1 01:23:42.515: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down R2(config-router)#network 192.168.12.0 R2(config-router)#network 192.168.12.0 *Mar 1 01:23:50.183: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 192.168.12.1 (Serial0/0) is up: new adjacency R2(config-router)#network 192.168.23.0 R3#int R3#int R3#conf R3#configure t R3#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R3(config)#ip add 192.168.13.3 255.255.255.0 ^ % Invalid input detected at '^' marker. R3(config)#int s 0/0 R3(config-if)#ip add 192.168.13.3 255.255.255.0 R3(config-if)#no sh R3(config-if)#no shutdown R3(config-if)# *Mar 1 01:26:18.555: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R3(config-if)# *Mar 1 01:26:19.559: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R3(config-if)#int s 0/1 R3(config-if)#ip add 192.168.23.3 255.255.255.0 R3(config-if)#no sh R3(config-if)#no shutdown R3(config)#int lo0 R3(config-if)# *Mar 1 01:28:14.019: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up R3(config-if)#ip add 3.3.3.3 255.255.255.0 R3(config-if)#no sh R3(config-if)#no shutdown R3(config-router)#router ei 1 R3(config-router)#network 192.168.23.0 R3(config-router)#network 192.168.13.0 R3(config-router)#network 3.0.0.0 R1#show ip eigrp neighbors IP-EIGRP neighbors for process 1 H Address Interface Hold Uptime SRTT RTO Q Seq (sec) (ms) Cnt Num 1 192.168.13.3 Se0/1 12 00:01:57 82 492 0 12 0 192.168.12.2 Se0/0 12 00:07:49 74 444 0 12 R1#sho R1#show ip ro Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set C 192.168.12.0/24 is directly connected, Serial0/0 C 192.168.13.0/24 is directly connected, Serial0/1 D 3.0.0.0/8 [90/2297856] via 192.168.13.3, 00:00:55, Serial0/1 D 192.168.23.0/24 [90/2681856] via 192.168.13.3, 00:02:27, Serial0/1 [90/2681856] via 192.168.12.2, 00:02:27, Serial0/0 R1#sho R1#show ip ei R1#show ip eigrp to R1#show ip eigrp topology IP-EIGRP Topology Table for AS(1)/ID(192.168.13.1) Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply, r - reply Status, s - sia Status P 3.0.0.0/8, 1 successors, FD is 2297856 via 192.168.13.3 (2297856/128256), Serial0/1 P 192.168.12.0/24, 1 successors, FD is 2169856 via Connected, Serial0/0 P 192.168.13.0/24, 1 successors, FD is 2169856 via Connected, Serial0/1 P 192.168.23.0/24, 2 successors, FD is 2681856 via 192.168.12.2 (2681856/2169856), Serial0/0 via 192.168.13.3 (2681856/2169856), Serial0/1 R1#show ip eigrp topology all R1#show ip eigrp topology all-links IP-EIGRP Topology Table for AS(1)/ID(192.168.13.1) Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply, r - reply Status, s - sia Status P 3.0.0.0/8, 1 successors, FD is 2297856, serno 5 via 192.168.13.3 (2297856/128256), Serial0/1 via 192.168.12.2 (2809856/2297856), Serial0/0 P 192.168.12.0/24, 1 successors, FD is 2169856, serno 1 via Connected, Serial0/0 P 192.168.13.0/24, 1 successors, FD is 2169856, serno 2 via Connected, Serial0/1 P 192.168.23.0/24, 2 successors, FD is 2681856, serno 4 via 192.168.12.2 (2681856/2169856), Serial0/0 via 192.168.13.3 (2681856/2169856), Serial0/1 R1#show ip protocols ------ 檢視全域性指令 負載均衡 負載均衡:同時出現了兩條路由到達目的地。並且metric值相等。提高了頻寬的利用率。 不等價負載均衡: --見圖 允許兩條優劣路由都放在路由表裡。--防止閒置頻寬:同時使用兩條鏈路, variance=2 自定義這個數 (20+10)=30<[2*FD=40] 這個時候30這個metric值就可以作為負載路由一起使用。 網路工程師概念:不是機房,不是弱電,是整個路由器,交換機等裝置組成的系統,上面跑了平臺,又有各種協議,根據客戶現場進需求行規劃。變成實施方案,最終落實, 多和行業內人士交流。 OSPF OSPF協議:鏈路狀態路由協議(開放式最短路徑優先)---用的最廣泛 --SPF演算法 很多園區網都在用 O:開放 共有的 沒有跳數限制 路由之間交流的是鏈路的狀態而不是直接的路由資訊,而距離向量路由協議交流的直接是路由資訊 狀態:這個介面到某個路由之間的開銷或鄰居關係。 根據開銷選擇 路徑,和頻寬成反比,頻寬越大,到達目的地的開銷越小。 cost=10的8次方/介面頻寬 頻寬=沿路入介面所有頻寬之和 OSPF報文型別 相當於婚戀過程 HELLO:建立初步關係 ,採用組播方式,224.0.0.5,發給所有執行OSPF協議的路由器 DBD:鏈路狀態表 LSA:具體資訊,在LSDB中 --這一步瞭解基本資訊,LSDB在拓撲表中, LSR:請求詳細情況--鏈路狀態資訊 LSU:給的答覆(包括了多了LSA) LSACK:確認報文的安全機制,對LSU中的LSA進行確認。 OSPF區域: 泛紅,每臺路由都要裝在小區內的所有資訊,浪費資源,所以區域要弄小點,且區域大,不易管理,且拓撲發生變化容易發生網路抖動, OSPF 區域劃分,以路由器為界限, OSPF三張表:鄰居表,拓撲表,OSPF路由表。 OSPF優勢 幾乎適應所有網路型別,包括乙太網,點對點序列鏈路,就是執行在OS七層的第二層,比如物理層是乙太網介面,在二層就會識別封裝成乙太網幀,如果是序列介面,就封裝成HPLC的幀,介面不一樣,封裝時候叫的名字也不一樣,然後OSPF就會根據這種不同的資料鏈路層進行操作,不同的資料鏈路就是不同的網路, 一共4種網路型別 廣播型:就是乙太網鏈路,比如在LAN中連線了多臺路由器,簡稱BMA。 序列鏈路:就是點對點模式,一條線兩頭各連一個路由,只有兩個 NBMA:也是多路型網路,但是不支援廣播和組播,最典型的封裝方式就是 x.25和幀中 萬用字元(反掩碼):用來匹配,=255.255.255.255-介面的掩碼 實驗--萬用字元 R1#configure t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int f 0/0 ^ % Invalid input detected at '^' marker. R1(config)#int s 0/0 R1(config-if)#ip add 192.168.12.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)# *Mar 1 00:03:55.751: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R1(config-if)# *Mar 1 00:03:56.755: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R1(config-if)# *Mar 1 00:04:23.955: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down R1(config-if)#rou R1(config-if)#router os R1(config-if)#ex R1(config)#router os R1(config)#router ospf 1 R1(config-router)#netw R1(config-router)#network 192.168.12.0 0.0.0.255 ar R1(config-router)#network 192.168.12.0 0.0.0.255 area 0 ---- 255.255.255.255-3個255 R1(config-router)# *Mar 1 00:08:03.955: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R1(config-router)# *Mar 1 00:09:35.611: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.2 on Serial0/0 from LOADING to FULL, Loading Done R2#conf R2#configure t R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#in R2(config)#interface s 0/0 R2(config-if)#ip add 192.168.12.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#no shutdown R2(config-if)# *Mar 1 00:07:49.223: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R2(config-if)#in *Mar 1 00:07:50.227: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R2(config-if)#in R2(config-if)#int R2(config-if)#ex R2(config)#int s 0/1 R2(config-if)#ip add 192.168.23.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#no shutdown R2(config-if)# *Mar 1 00:08:47.295: %LINK-3-UPDOWN: Interface Serial0/1, changed state to up R2(config-