




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、Cisco HSRP的配置 雙機熱備經典案例 HSRP一般用于兩臺,也可以用于多臺。必須在每臺起HSRP上的路由器上配置。 When the HSRP is configured on a network segment, IT provides a virtual Media Access Control (MAC) address&
2、#160;and an IP address that is shared among routers in a groupof routers that is running HSRP. One of these devices is selected by the protocol to be the a
3、ctive router. The active router receives and routes packets destined for the group's MAC address. For n routers running HSRP, there are n + 1 IP and MAC add
4、resses assigned. 但是aceive只有一臺,standby只有一臺,其實其他的都在監聽狀態。所以zyx說的是處在active和standby的狀態的只有兩臺。 附一個配置實例: version 12.0 service timestamps debug uptime service timestamps log uptime no service p
5、assword-encryption ! hostname r1 ! enable password cisco ! ip subnet-zero (新版的IOS都支持全0/1子網) ! ! ! ! interface Ethernet0 ip address
6、60;01 no ip redirects no ip directed-broadcast standby 150 timers 5 15 /* 定義150組5秒交換一次hello信息,15秒沒收到 hello信息就開始切換 */ standby 150 priority 110 /*
7、160;定義150組的主路由器權值,值越大,為主路由器希望越大 */ standby 150 preempt /* enable 150組的hsrp搶占功能 */ standby 150 authentication cisco /* 設置150組的router身份驗證串 */ standby 150 ip 00 /* 定義1
8、50組的浮動地址,也是這臺router 連接的網絡的網關 */ standby 150 track Ethernet0 /* 定義監控的端口 */ ! interface Serial0 no ip address no ip directed-broadcast no ip mroute-cache
9、160; shutdown no fair-queue ! ip classless ! ! line con 0 transport input none line 1 16 line aux 0 line vty 0 4
10、160;password cisco login ! end 配置基本HSRP例子: 提問 "當主用路由器當掉以后備份路由器可以接管主用路由器的IP地址和MAC地址 回答 Router1: Router1#configure terminal Enter configuration commands, one per
11、160;line. End with CNTL/Z. Router1(config)#interface FastEthernet 0/1 Router1(config-if)#ip address Router1(config-if)#standby 1 ip Router1(config-if)#standby 1
12、 priority 120 Router1(config-if)#exit Router1(config)#end Router1# Router2: Router2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Rout
13、er2(config)#interface FastEthernet 1/0 Router2(config-if)#ip address Router2(config-if)#standby 1 ip Router2(config-if)#standby 1 priority 110 (默認priority is 100
14、) Router2(config-if)#exit Router2(config)#end Router2# 注釋 由于HSRP虛擬出來的MAC地址跟組相關,所以可能會出現同一交換機收到多個相同的MAC地址的情況,這時候就需要用standby 1 mac-address 0000.0c07.ad01 命令來人工指定一個MAC地址 提問 強制某個路由器啟動后一直在組中處于主用狀態 回答
15、; Router1#configure terminal Enter configuration commands, one per line. End wITh CNTL/Z. Router1(config)#interface FastEthernet 0/1 Router1(config-if)#standby 1 ip Route
16、r1(config-if)#standby 1 priority 120 Router1(config-if)#standby 1 preempt Router1(config-if)#exit Router1(config)#end Router1# Router2#configure terminal Enter configuration commands, one
17、160;per line. End with CNTL/Z. Router2(config)#interface FastEthernet 1/0 Router2(config-if)#standby 1 ip Router2(config-if)#standby 1 priority 110 Router2(config-if)#standby 1
18、0;preempt delay 60 (最好有時延) Router2(config-if)#exit Router2(config)#end Router2# 注釋 正常情況下當LAN端口up后就會發生強占,而此時可能網絡還沒有收斂,所以建議配置強占延遲時間,讓路由器啟動后過一段時間再發起強占standby 1 preempt delay 60 22.3. 配置HSRP對接口問題追蹤的支持
19、0; 提問 當主用路由器的上聯端口出現問題后主動切換到備用路由器 回答 Router1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#interface FastEthernet0/1 Router1(config-if)#
20、standby 1 ip Router1(config-if)#standby 1 priority 120 Router1(config-if)#standby 1 preempt Router1(config-if)#standby 1 track Serial0/0 20 Router1(config-if)#exit Router1(co
21、nfig)#end Router1# 從12.2(15)T后引入更多可追蹤實例 Router1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#track 11 interface Serial1/1 ip
22、;routing Router1(config-track)#exit Router1(config)#interface FastEthernet0/0 Router1(config-if)#standby 1 ip Router1(config-if)#standby 1 priority 120 Router1(config-if)#standby 1 preempt&
23、#160; Router1(config-if)#standby 1 track 11 decrement 50 Router1(config-if)#end Router1# 注釋 Router1#show track Track 11 Interface Serial1/1 ip routing IP routing is
24、 Down (hw admin-down, ip disabled) 1 change, last change 00:12:48 Tracked by: HSRP FastEthernet0/0 1 22.4. HSRP負載均衡 提問 在兩臺或者多臺HSRP路由器上實現流量的負載均衡 回答 Router
25、1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#interface FastEthernet0/1 Router1(config-if)#ip address Router1(conf
26、ig-if)#standby 1 ip Router1(config-if)#standby 1 priority 120 Router1(config-if)#standby 1 preempt Router1(config-if)#standby 2 ip Router1(config-if)#standby 2 priority&
27、#160;110 Router1(config-if)#standby 2 preempt Router1(config-if)#exIT Router1(config)#end Router1# Router2#configure terminal Enter configuration commands, one per line. End with CNTL/Z
28、. Router2(config)#interface FastEthernet1/0 Router2(config-if)#ip address Router2(config-if)#standby 1 ip Router2(config-if)#standby 1 priority 110 Router2(con
29、fig-if)#standby 1 preempt Router2(config-if)#standby 2 ip Router2(config-if)#standby 2 priority 120 Router2(config-if)#standby 2 preempt Router2(config-if)#exit Router2(config)#end
30、0; Router2# 注釋 由于出現兩個網關,所以需要在終端設備上分開配置各自的缺省網關。 22.5. HSRP中ICMP重定向 提問 在HSRP中啟用ICMP重定向 回答 Router2#configure terminal Enter configuration commands, one per line. End with C
31、NTL/Z. Router2(config)#interface FastEthernet 1/0 Router2(config-if)#no ip redirects Router2(config-if)#standby redirects disable Router2(config-if)#exit Router2(config)#end Router2# 注釋
32、160;22.6. 調整HSRP定時器 提問 調整備份路由器接管主用路由器所需時長 回答 Router1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#interface FastEthernet0/1
33、;Router1(config-if)#standby 1 ip Router1(config-if)#standby 1 priority 120 Router1(config-if)#standby 1 preempt Router1(config-if)#standby 1 timers 1 3 Router1(config-if)#exit
34、0;Router1(config)#end Router1# 注釋 缺省Hello包時長為3秒,10秒后會接管,如果主用路由器調整時長,整個組內的路由器都要調整為相同的時長。最短可以到達毫秒Router1(config-if)#standby 1 timers msec 100 msec 300 22.7. 在令牌環網絡中使用HSRP 提問 在令牌環網絡中配置HSRP 回答
35、如果只用IP協議配置同前面例子,如果還有其他協議,特別是使用了source-route bridging就用下面的配置方法 Router1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#interface Tokenring0 Router1(config
36、-if)#ip address Router1(config-if)#standby ip Router1(config-if)#standby use-bia Router1(config-if)#standby priority 120 Router1(config-if)#standby preempt Router1(config-if)#exit
37、0; Router1(config)#end Router1# Router2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router2(config)#interface Tokenring0 Router2(config-if)#ip addres
38、s Router2(config-if)#standby ip Router2(config-if)#standby use-bia Router2(config-if)#standby priority 110 Router2(config-if)#standby preempt Router2(config-if)#exit Router2(con
39、fig)#end Router2# 注釋 由于令牌環網絡會用到設備的MAC地址信息,所以如果HSRP用到虛擬MAC就會出問題,因此在配置中使用了burned-in address (BIA)來代替MAC來避免出現問題HSRP配置: R1#show runBuilding configuration.Current configuration : 907 bytes!version 12.1no service single
40、-slot-reload-enableservice timestamps debug uptimeservice timestamps log uptimeno service password-encryption!hostname R1!ip subnet-zero!interface FastEthernet0/0ip address no ip redirectsduplex&
41、#160;autospeed autostandby 1 ip 00 /定義1組的浮動地址,也是ROUTER,連接網絡的網關standby 1 timers 2 10 /定義1組每2秒交換一次hello信息包,10秒沒收到hello信息包就切換standby 1 priority 150 /定義1組的優先級,值越大,
42、優先級越高standby 1 preempt /定義1組的HSRP組的搶占功能standby 1 authentication cisco /定義1組的驗證字符standby 1 track Serial1/0 /定義1組的監控口(可選)!interface Serial1/0ip address 255.
43、255.255.0serial restart-delay 0!interface Serial1/1no ip addressshutdownserial restart-delay 0!interface Serial1/2no ip addressshutdownserial restart-delay 0!interface Serial1/3no ip addressshutdownserial restart-delay
44、160;0!router ripversion 2passive-interface FastEthernet0/0network network !ip classlessip http server!line con 0line aux 0line vty 0 4login!end Cisco的熱備份路由協議(HSRP)可以在工作站A的確省網關失效時提供一個備份路由器,HSRP可以創
45、建一個具有虛擬MAC地址和虛擬IP地址的虛擬路由器。假設有兩個路由器Bluestudy A和Bluestudy B,通過兩路指向路由器Bluestudy C:對于Bluestudy A,假設E0/0的IP地址為/24對應內部網絡是/24 S0/0的IP地址為/24 對應外部網絡是/24。對于Bluestudy B,假設E0/0的IP地址為/24 對應內部網絡是/24 S0/0
46、的IP地址為/24 對應外部網絡是/24。虛擬IP地址為/24對于Bluestudy C,因與本實驗無太大聯系,暫時不做說明。下面給出兩只路由器的配置,其中將Bluestudy A作為主路由器,Bluestudy B作為備份路由器。其中給出Bluestudy A的優先級為120,而Bluestudy B采用默認優先級100,這樣就可以使Bluestudy A成為主路由器。Bluestudy A:Interface ethernet0/0Ip
47、 address No ip redirectsStandby 1 priority 120Standby 1 preemptStandby 1 ip !interface serial0/0ip address no shut!router igrp 100network
48、160;network Bluestudy B:Interface ethernet0/0Ip address Standby 1 preemptStandby 1 ip !interface serial0/0ip address no shut!router
49、 igrp 100network network 只要將相應的下連主機的網關設成 就可以了.VRRP的配置 一、設備、線路備份 說明: 1、 當虛擬路由器的IP地址與某一VLAN的IP地址相同時,則包含此VLAN的設備優先級就立刻升為最高(255),此設備為MASTER,另一個設備為BACKUP2、 當FLEX1或者FLEX2的任何一臺設備DOWN掉,另外一臺就起到備份作用,因為ICMP的request和reply的路
50、徑存在3、 當斷掉FLEX1的V1所連的線或者斷掉FLEX2的V2所連的線時, PC1與PC2仍然可以通訊!因為VRRP可以檢查到主備線路的連接狀態,起到線路備份的作用。4、 當斷掉FLEX1的V2所連的線或者斷掉FLEX2的V1所連的線時, PC1與PC2就不能通訊了!因為VRRP在判斷主備關系時是相對此接收端口而言的,對轉發接口不進行判斷,所以端掉以上其中的一條線ICMP的request或者reply的路徑就被斷掉了。5、 PC1的網關設為roter 100的IP(1),PC2的網關設為router 111
51、的IP(6) Flex24_1配置Create vlan v1Config vlan v1 add port 1 untaggedConfig vlan v1 ipaddress 1/8Create vlan v2Config vlan v2 add port 2 untaggedConfig vlan v2 ipad
52、dress 5/8Create virtual route 100Config virtual route 100 ipaddress 1/8Config virtual route 100 interface v1Config virtual route 100 priority 50Config vrrp enableConfig virtual
53、 route 100 enableCreate virtual route 111Config virtual route 111 ipaddress 6/8Config virtual route 111 interface v2Config virtual route 111 priority 150Config vrrp enableConfig&
54、#160;virtual route 111 enable FLEX24_2配置Create vlan v1Config vlan v1 add port 1 untaggedConfig vlan v1 ipaddress 2/8Create vlan v2Config vlan v2 add port 2 untag
55、gedConfig vlan v2 ipaddress 6/8Create virtual route 100Config virtual route 100 ipaddress 1/8Config virtual route 100 interface v1Config virtual route 100 priority 150Config
56、60;vrrp enableConfig virtual route 100 enableCreate virtual route 111Config virtual route 111 ipaddress 6/8Config virtual route 111 interface v2Config virtual route 111 priority
57、50Config vrrp enableConfig virtual route 111 enable 二、設備備份 說明:1、 如果在兩個交換機上只配置一個VLAN,因此其中的一臺設備作為主,另一臺為備2、 當主設備DOWN掉時,備份設備會在1秒左右的時間接管主設備的工作,當主設備恢復后,主設備會恢復它的工作。3、 主設備會向備份路由器發送周期性廣播報文,備份設備會不斷的監聽主設備的狀態,并時刻準備接管主設備。4、 主設備的廣播周期缺省為
58、1秒,可以進行手工設置。5、 虛擬路由器的缺省模式為搶占模式(搶占模式是指是否允許優先級高的備份路由器取代低優先級的主路由器的模式)6、 PC1和PC2的網關都設為router 100的IP(1)7、 詳細配置見配置手冊。 Flex24_1配置Create vlan v1Config vlan v1 add port 1 untaggedConfig vlan v1 ipaddress
59、1/8Create virtual route 100Config virtual route 100 ipaddress 1/8Config virtual route 100 interface v1Config virtual route 100 priority 50Config vrrp enableConfig virtual route 1
60、00 enable FLEX24_2配置Create vlan v1Config vlan v1 add port 1 untaggedConfig vlan v1 ipaddress 2/8Create virtual route 100Config virtual route 100 ipaddress 1/8Config
61、 virtual route 100 interface v1Config virtual route 100 priority 150Config vrrp enableConfig virtual route 100 enable VRRP簡介 隨著Internet的迅猛發展,基于網絡的應用逐漸增多。這就對網絡的可靠性提出了越來越高的要求。斥
62、資對所有網絡設備進行更新當然是一種很好的可靠性解決方案;但本著保護現有投資的角度考慮,可以采用廉價冗余的思路,在可靠性和經濟性方面找到平衡點。 虛擬路由冗余協議就是一種很好的解決方案。在該協議中,對共享多存取訪問介質(如以太網)上終端IP設備的默認網關(Default Gateway)進行冗余備份,從 而在其中一臺路由設備宕機時,備份路由設備及時接管轉發工作,向用戶提供透明的切換,提高了網絡服務質量。 一、協議概述 在基于TCP/IP協議的網絡中,為了保證不直接物理連接的設備之間的通信
63、,必須指定路由。目前常用的指定路由的方法有兩種:一種是通過路由協議(比如:內部路由協議RIP和 OSPF)動態學習;另一種是靜態配置。在每一個終端都運行動態路由協議是不現實的,大多客戶端操作系統平臺都不支持動態路由協議,即使支持也受到管理開銷、收斂度、安全性等許多問題的限制。因此普遍采用對終端IP設備靜態路由配置,一般是給終端設備指定一個或者多個默認網關(Default Gateway)。靜態路由的方法簡化了網絡管理的復雜度和減輕了終端設備的通信開銷,但是它仍然有一個缺點:如果作為默認網關的路由器損壞,所有使用該網關為下一跳主機的通信必然要中斷。即便配置了多個默認網關,如不重新啟動終端設備,也不能切換到新的網關。采用虛擬路由冗余協議 (Virtual Router Redund
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 嶺南師范學院《工程造價算量信息化綜合》2023-2024學年第一學期期末試卷
- 寧夏醫科大學《器官-系統模塊三》2023-2024學年第二學期期末試卷
- 陜西省安康市名校2025年初三第二學期第二次三模生物試題含解析
- 新疆烏魯木齊第六十六中學2025年初三8月開學聯考物理試題理試題含解析
- 三明市重點中學2025屆高三下學期聯考期末試卷生物試題含解析
- 荊州學院《互聯網創業與創新實踐》2023-2024學年第二學期期末試卷
- 江蘇省射陽縣2025年中考化學試題仿真試題(二)含解析
- 溫州肯恩大學《臨床思維與臨床技能規培》2023-2024學年第一學期期末試卷
- 山東省濟寧市鄒城一中2025年高三下學期最后一次模擬考試試卷生物試題含解析
- 遼寧中醫藥大學杏林學院《工程概預算設計》2023-2024學年第一學期期末試卷
- 強酸強堿燒傷及中毒的處理方法
- 施工員培訓課件(PPT-54張)
- 廠家管道吹掃方案(參考)
- 軋鋼高線車間裝配工工藝規程
- 鋼板樁施工專項方案
- 水土保持常用監測表格(共9頁)
- PPT翻書動畫效果的制作
- 病理學第十六章-神經系統疾病
- 上海市南匯區醫院檢驗科生物安全手冊
- 股權投資郵箱
- 消防設施移交和清單-(精編版)
評論
0/150
提交評論