策略路由是一種比基于目標網絡進行路由更加靈活的數據包路由轉發機制。應用了策略路由,路由器將通過路由圖決定如何對需要路由的數據包進行處理,路由圖決定了一個數據包的下一跳轉發路由器。 下面讓我們通過一個實驗來看一下雙出口配置是怎樣的過程。
策略路由實驗拓樸:

策略路由實驗要求:
1、R1連接本地子網,R2為邊緣策略路由器,R3模擬雙ISP接入的Internet環境。
2、要求R1所連接的局域網部分流量走R2-R3間上條鏈路(ISP1鏈路),部分流量走R2-R3間下條鏈路(ISP2鏈路)從而實現基于源的供應商鏈路選擇和網絡負載均衡。
各路由器配置如下:
- R1#sh run //路由器R1的配置
-
- interface Loopback0 //模擬子網一:192.168.1.0/24
-
- ip address 192.168.1.1 255.255.255.0 //模擬子網中第一臺億恩科技主機
-
- ip address 192.168.1.2 255.255.255.0 secondary //模擬子網中第二臺億恩科技主機
-
- !
-
- interface Loopback2 //模擬子網二:192.168.2.0/24
-
- ip address 192.168.2.1 255.255.255.0
-
- ip address 192.168.2.2 255.255.255.0 secondary
-
- !
-
- interface FastEthernet0/0
-
- ip address 12.0.0.1 255.255.255.0
-
- bitscn.com
-
- !
-
- !
-
- router rip //通過RIP協議配置網絡的連通性
-
- version 2 bitscn.com
-
- network 192.168.1.0
-
- network 192.168.1.0
-
- network 12.0.0.0
-
- R3#sh run //路由器R3的配置
-
- Building configuration
-
- interface Loopback0 //模擬一個連接目標
-
- description to internet
-
- ip address 100.100.100.100 255.255.255.0
-
- !
-
- interface Serial1/1 //模擬ISP1的接入端口
-
- ip address 123.0.0.3 255.255.255.0
-
- serial restart-delay 0
-
- !
-
- interface Serial1/3 //模擬ISP2的接入端口
-
- bitscn.com
-
- ip address 223.0.0.3 255.255.255.0
-
- serial restart-delay 0
-
- !
-
- router rip
-
- version 2
-
- network 100.0.0.0
-
- network 123.0.0.0
-
- network 223.0.0.0
-
- no auto-summary
-
- !
-
- end
-
- R2#sh run //策略路由器R2的配置
-
- Building configuration...
-
- interface FastEthernet0/0
-
- ip address 12.0.0.2 255.255.255.0
-
- ip policy route-map isp-test //在接口上啟用策略路由isp-test進行流量控制
-
- duplex half
-
- !
-
- interface Serial1/1
-
- ip address 123.0.0.1 255.255.255.0
-
- serial restart-delay 0
-
- ! bitscn_com
-
- interface Serial1/3
-
- ip address 223.0.0.1 255.255.255.0 bitscn.com
-
- serial restart-delay 0
-
- router rip
-
- version 2
-
- network 12.0.0.0
-
- network 123.0.0.0
-
- network 223.0.0.0
-
- no auto-summary
-
- logging alarm informational
-
- access-list 101 permit ip 192.168.1.0 0.0.0.255 host 100.100.100.100 //訪問控制列表101,用于過濾原地址,允許子網192.168.1.0流量通過 */
-
- access-list 102 permit ip 192.168.2.0 0.0.0.255 host 100.100.100.100 //訪問控制列表102,用于過濾原地址,允許子網192.168.2.0流量通過 */
-
- !
-
- route-map isp-test permit 10 //定義route-map,取名為isp-test,序列為10
-
- match ip address 101 //檢查源地址,匹配acl 101
-
- set ip default next-hop 123.0.0.3 //指定下一跳地址
-
- !
-
- feedom.net
-
- route-map isp-test permit 20 //定義isp-test的第二條語句,序列號為20
-
- match ip address 102 //檢查源地下,匹配acl102
-
- set ip default next-hop 223.0.0.3
-
- !
-
- route-map isp-test permit 30 //定義isp-test的第三條語句,序列號為30
-
- set default interface Null0 //丟棄不匹配規定標準的包
-
- end
-
- ---------------------------------------------------------------------------------
策略路由的內容不僅僅局限于以上介紹的內容,我們還會在以后的文章中繼續向大家介紹。 本文出自:億恩科技【www.endtimedelusion.com】
服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]
|