日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

Cisco 基于策略路由的配置實(shí)例


問題描述:您可以定義自己的規(guī)則來進(jìn)行數(shù)據(jù)包的路由而不僅僅由目的地地址所決定 。在這里您可以學(xué)到怎么使用基于策略路由的辦法來解決這一問題 。在具體的應(yīng)用中 , 基于策略的路由有:
☆ 基于源IP地址的策略路由
☆ 基于數(shù)據(jù)包大小的策略路由
☆ 基于應(yīng)用的策略路由
☆ 通過缺省路由平衡負(fù)載
這里 , 講述了第一種情況的路由策略
舉例:在這個(gè)例子中 , 防火墻的作用是:把10.0.0.0/8內(nèi)部網(wǎng)地址翻譯成可路由的172.16.255.0/24子網(wǎng)地址 。
下面的防火墻配置是為了完整性而加進(jìn)去的 , 它不是策略路由配置所必需的 。在這里的防火墻可以被其它類似的產(chǎn)品代替 , 如PIX或其它類似防火墻設(shè)備 。這里的防火墻的配置如下:
!
ip nat pool net-10 172.16.255.1 172.16.255.254 prefix-length 24
ip nat inside source list 1 pool net-10
!
interface Ethernet0
 ip address 172.16.20.2 255.255.255.0
 ip nat outside
!
interface Ethernet1
 ip address 172.16.39.2 255.255.255.0
 ip nat inside
!
router eigrp 1
 redistribute static
 network 172.16.0.0
 default-metric 10000 100 255 1 1500
!
ip route 172.16.255.0 255.255.255.0 Null0
Access-list 1 permit 10.0.0.0 0.255.255.255
!
end
在我們的例子中 , Cisco WAN路由器上運(yùn)行策略路由來保證從10.0.0.0/8網(wǎng)絡(luò)來的IP數(shù)據(jù)包被發(fā)送到防火墻去 。配置中定義了兩條net-10策略規(guī)則 。第一條策略就定義了從10.0.0.0/8網(wǎng)絡(luò)來的IP數(shù)據(jù)包被發(fā)送到防火墻去(我們很快會(huì)看到這里的配置有問題) 。而第二條規(guī)則答應(yīng)所有的其它數(shù)據(jù)包能按正常路由 。這里的Cisco WAN路由器的配置如下:
!
interface Ethernet0/0
 ip address 172.16.187.3 255.255.255.0
 no ip directed-broadcast
!
interface Ethernet0/1
 ip address 172.16.39.3 255.255.255.0
 no ip directed-broadcast
!
interface Ethernet3/0
 ip address 172.16.79.3 255.255.255.0
 no ip directed-broadcast
 ip policy route-map net-10
!
router eigrp 1
 network 172.16.0.0
!
access-list 110 permit ip 10.0.0.0 0.255.255.255 172.16.36.0 0.0.0.255
access-list 111 permit ip 10.0.0.0 0.255.255.255 any
!
route-map net-10 permit 10
 match ip address 111
 set interface Ethernet0/1
!
route-map net-10 permit 20
!
end
我們可以這樣測試我們所做的配置 。在名為Cisco-1的路由器10.1.1.1上發(fā)送ping命令到Internet上的一個(gè)主機(jī)(這里就是192.1.1.1主機(jī)) 。要查看名為Internet Router的路由器上的情況 , 我們?cè)谔貦?quán)命令模式下執(zhí)行debug ip packet 101 detail命令 。(其中 , 在此路由器上有access-list 101 permit icmp any any配置命令) 。下面是輸出結(jié)果:
Results of ping from Cisco-1 to 192.1.1.1/internet taken from Internet_Router:
Pakcet never makes it to Internet_Router
正如您所看到的:數(shù)據(jù)包沒有到達(dá)Internet_Router路由器 。下面的在Cisco WAN路由器上的debug命令給出了原因:
Debug commands run from Cisco_WAN_Router:
"debug ip policy"
2d15h: IP: s=10.1.1.1 (Ethernet3/0), d=192.1.1.1, len 100, policy match
2d15h: IP: route map net-10, item 10, permit
2d15h: IP: s=10.1.1.1 (Ethernet3/0), d=192.1.1.1 (Ethernet0/1), len 100, policy routed
2d15h: IP: Ethernet3/0 to Ethernet0/1 192.1.1.1
這里 , 數(shù)據(jù)包確實(shí)匹配了net-10策略圖中的第一條規(guī)則 。但為什么還是沒有達(dá)到預(yù)期的目的呢?用"debug arp"來看一下 。
"debug arp"
2d15h: IP ARP: sent req src 172.16.39.3 0010.7bcf.5b02,
dst 192.1.1.1 0000.0000.0000 Ethernet0/1

推薦閱讀