ITPub博客

首页 > IT基础架构 > 网络安全 > ccnp学习013--路由与交换(05路由更新与控制)

ccnp学习013--路由与交换(05路由更新与控制)

原创 网络安全 作者:newdayhope 时间:2006-03-13 08:17:43 0 删除 编辑

一 如何控制路由流量

在路由上有多个方法,有完全阻止,过滤,路由表,map,以及策略规划等.

1.passive-interface command在接口上完全阻止

EX:passiver-interface s0(关闭S0口)

no passiver-interface s1(打开S1口,RIP协议在默认的情况下是关闭的.)

2.route filtes

配置分发列表.

在出的方向配置

(config-router)#distribute-list {access-list-number|name} out {interface-name|routeing-process|[automous-system number]}

在进的方向.

#distribute-list {access-list-number|name} in [type number]

因为ospf路由之间不是交换的路由信息,而交换的是LSA,所以在出的方向配置再发布是没有意义的,但在进的方向配置是起作用的.

例子:

ROUTER B(10.0.0.8/30)接口s1 and s3)分别与ROUTERA(10.1.0.0 10.2.0.0 10.3.0.0)和ROUTERC(10.8.0.0 10.9.0.0 10.10.0.0 10.11.0.0)相连

routerB配置

router ospf 1

network 10.0.0.8 0.0.0.255 area 0

redistribute rip subnets

distribute-list 2 out rip

!

router rip

network 10.0.0.0

version 0

passiver-interface s3

redistribute ospf 1 metric 5

distribute-list 3 out ospf 1

access-list 2 deny 10.3.0.0 0.0.255.255

access-list 2 permit any

access-list 3 permit 10.9.0.0

3.用route map 来控制更新.


与访问列表相似,都是自上而下的匹配.主要应用:

策略规定.BGP策略应用.再发布的应用.

4.route map的操作.

route-map my_bgp permit 10

:::::::::::::::::::::::

{match statements}

:::::::::::::::::::::::::::

{set statements }

route-map my_bgp deny 20

:::::::::::::::::::::

match ip address x y z 此时表示的关系是or关系,满足任何一个关系就可以

match ....a

match.....b

match.....c

此时的关系是and关系,三个关系才能满足才符合条件.

5.

(config-router)#redistribute protocol [process-id]

route-map map-tag

(config)#route-map map-tag [permit|deny][sequence-number]

(config-route-map)#match {conditions }

(config-route-map)#set {actions}

6.match {iptions}

options:

ip address ip-access-list

ip route-source ip-access-list

ip next-hop ip address-list

ip default-next-hop ip address-list

interface type number

metric metric-value

route-type [external|internal|level-1|level-2|local]

还有其它的.

set {options}匹配之后再做修改.

EX:

(config)#route ospf 1

(config-route)#redistribute rip route-map redis-rip

!

(config)#route-map redis-rip permit 10

match ip address 23 29

set metric 500

set metric-type type-1

route-map redis-rip deny 20

match ip address 37

route-map redis-rip permit 30

set metric 5000

set metric-type type-2

access-list 23 permit 10.1.0.0 0.0.255.255

access-list 29 permit 172.16.1.0 0.0.0.255

access-list 37 permit 10.0.0.0 0.255.255.255

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/181629/viewspace-819927/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    379
  • 访问量
    13243023