路由過濾詳解

路由過濾詳解。


(一) Route Maps
特性:
Route Maps類似於access lists,不同之處在於Route Maps可以改變Packets/Routes的部分屬性。

用途:
Route Maps主要用於Redistribution和Policy Routing及BGP的實現。

實現:
Policy Routing發送Packets到Route Maps實現策略路由轉發。
Redistribution發送Routes到Route Maps實現路由條目的過濾。

配置說明:
Route Maps如果沒有指定Action及Sequence Number屬性,默認:
Action: permit
Sequence Number: 10
且Sequence Number不會自動增加。
即如果在使用Route Maps語句時不指定Sequence Number,則覆蓋Sequence Number爲10的默認條目。

Route Maps Deny Action:
Redistribution: 特定路由條目不會被重分佈。
Policy Routing: 特定的Packets不會按策略路由轉發,但會梗概正常的路由表條目轉發。

Case Study:Policy Routing
注:(1)Policy Routing隻影響入流量。
(2)可以使用Standard及Extended ACL。
(3)全局配置ip local policy route-map sense可將策略路由應用於Router本身發送的Packets.
<1> Standard ACL
interface Serial 0
ip address 172.16.5.1 255.255.255.0
ip policy route-map sense
!
access-list 1 permit 172.16.6.0 0.0.0.255
access-list 2 permit 172.16.7.0 0.0.0.255
!
route-map sense permit 10
match ip address 1
set ip next-hop 172.16.4.2
!
route-map sense permit 20
match ip address 2
set ip next-hop 172.16.4.3

<2> Extended ACL
interface Ethernet 0
ip address 172.16.1.4 255.255.255.0
ip policy route-map sense
!
access-list 105 permit tcp 172.16.1.0 0.0.0.255 eq ftp any
access-list 105 permit tcp 172.16.1.0 0.0.0.255 eq ftp-data any
access-list 106 permit tcp 172.16.1.0 0.0.0.255 eq telnet any
!
route-map sense permit 10
match ip address 105
set ip next-hop 172.16.2.1
!
route-map sense permit 20
match ip address 106
set ip next-hop 172.16.3.1

<3> Length of the Packets
interface Ethernet0
ip address 172.16.1.4 255.255.255.0
ip policy route-map sense
!
route-map sense permit 10
match length 1000 1600
set ip next-hop 172.16.2.1
!
route-map sense permit 20
match length 0 400
set ip next-hop 172.16.3.1

<4> Router's Packets
interface Ethernet0
ip address 172.16.1.4 255.255.255.0
ip policy route-map sense
!
ip local policy route-map sense
!
access-list 120 permit ip any 172.16.1.0 0.0.0.255
access-list 120 permit ospf any any
!
route-map sense permit 10
match ip address 120
!
route-map sense permit 20
match length 1000 1600
set ip next-hop 172.16.2.1
!
route-map sense permit 30
match length 0 400
set ip next-hop 172.16.3.1

注:如果沒有第一個route-map條目,router本身的Packets及OSPF的Packets都會由於後兩個route-map語句被轉發到錯誤的地址。

Case Study: Policy Routing and Quality of Service Routing
Policy Routing結合ip包頭的Precedence和Type of Service(TOS)可以實現基於QOS的策略路由。
注:Precedence和TOS的配置既可使用Number字段,也可以使用Keyword。

set ip precedence
-------------------------------------
Bits Number Keyword
000 0 routine
001 1 priority
010 2 immediate
011 3 flash
100 4 flash-override
101 5 critical
110 6 internet
111 7 network
-------------------------------------
set ip tos
-------------------------------------
Bits Number Keyword
0000 0 normal
0001 1 min-monetary-cost
0010 2 max-reliability
0100 4 max-throughput
1000 8 min-delay
-------------------------------------

interface Serial0
ip address 10.1.18.67 255.255.255.252
ip policy route-map sense
!
interface Serial1
ip address 10.34.16.83.255.255.255.252
ip policy route-map sense
!
access-list 1 permit 172.16.0.0 0.0.255.255
access-list 110 permit tcp any eq www any
!
route-map sense permit 10
match ip address 1 110
set ip precedence critical
!
route-map sense permit 20
set ip tos 10
set ip precedence priority

Case Study: Route Tagging
用途:
用於雙向重分佈時標識特定Domain的路由,以防路由被重分佈回起源Domain。

使用方案:
通告路由條目的邊緣Router在重分佈時給路由條目加上Tag標識,做爲Transit Network的Domain,不需要使用和識別Tag,僅僅需要將它傳遞到它的外部網絡即可。

路由協議相關:
Support: RIPv2,EIGRP,IS-IS,OSPF,BGP
Not Support: RIPV1,IGRP

Packets Format:
RIPv2: 支持16-bit tags

發佈了9 篇原創文章 · 獲贊 13 · 訪問量 24萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章