策略路由是一種比基于目標(biāo)網(wǎng)絡(luò)進(jìn)行路由更加靈活的數(shù)據(jù)包路由轉(zhuǎn)發(fā)機(jī)制。應(yīng)用了策略路由,路由器將通過路由圖決定如何對(duì)需要路由的數(shù)據(jù)包進(jìn)行處理,路由圖決定了一個(gè)數(shù)據(jù)包的下一跳轉(zhuǎn)發(fā)路由器。 下面讓我們通過一個(gè)實(shí)驗(yàn)來看一下雙出口配置是怎樣的過程。
策略路由實(shí)驗(yàn)拓樸:
策略路由實(shí)驗(yàn)要求:
1、R1連接本地子網(wǎng),R2為邊緣策略路由器,R3模擬雙ISP接入的Internet環(huán)境。
2、要求R1所連接的局域網(wǎng)部分流量走R2-R3間上條鏈路(ISP1鏈路),部分流量走R2-R3間下條鏈路(ISP2鏈路)從而實(shí)現(xiàn)基于源的供應(yīng)商鏈路選擇和網(wǎng)絡(luò)負(fù)載均衡。
各路由器配置如下:
- R1#sh run //路由器R1的配置
-
- interface Loopback0 //模擬子網(wǎng)一:192.168.1.0/24
-
- ip address 192.168.1.1 255.255.255.0 //模擬子網(wǎng)中第一臺(tái)億恩科技主機(jī)
-
- ip address 192.168.1.2 255.255.255.0 secondary //模擬子網(wǎng)中第二臺(tái)億恩科技主機(jī)
-
- !
-
- interface Loopback2 //模擬子網(wǎng)二: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協(xié)議配置網(wǎng)絡(luò)的連通性
-
- 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 //模擬一個(gè)連接目標(biāo)
-
- 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進(jìn)行流量控制
-
- 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,用于過濾原地址,允許子網(wǎng)192.168.1.0流量通過 */
-
- access-list 102 permit ip 192.168.2.0 0.0.0.255 host 100.100.100.100 //訪問控制列表102,用于過濾原地址,允許子網(wǎng)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的第二條語句,序列號(hào)為20
-
- match ip address 102 //檢查源地下,匹配acl102
-
- set ip default next-hop 223.0.0.3
-
- !
-
- route-map isp-test permit 30 //定義isp-test的第三條語句,序列號(hào)為30
-
- set default interface Null0 //丟棄不匹配規(guī)定標(biāo)準(zhǔn)的包
-
- end
-
- ---------------------------------------------------------------------------------
策略路由的內(nèi)容不僅僅局限于以上介紹的內(nèi)容,我們還會(huì)在以后的文章中繼續(xù)向大家介紹。 本文出自:億恩科技【1tcdy.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|