注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 51CTO三周年庆典之IT北斗..
 帮助

CCNP-25 分配列表(BSCI)


2007-11-09 08:44:36
 标签:CCNP-25 分配列表   [推送到技术圈]

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://loveme23.blog.51cto.com/7891/49793

CCNP-25 分配列表

试验拓扑:

实验要求:R1R2OSPF,在R1上起LOOPBACK地址用于测试,分别配置分配列表来过滤不必要的路由更新。
试验目的:掌握基本的分配列表和路由重发布中分配列表的配置方法。

试验配置:
R1
R1(config)#int s1/0
R1(config-if)#ip add 199.99.1.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shu
R1(config-if)#exit
R1(config)#int loop0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#int loop1
R1(config-if)#ip add 172.16.1.1 255.255.255.0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#exit
R1(config)#int loop2
R1(config-if)#ip add 172.16.2.1 255.255.255.0
R1(config-if)#ip ospf network point-to-point
R1(config-if)#exit
R1(config)#router ospf 100
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 199.99.1.0 0.0.0.255 area 0   
R1(config-router)#network 172.16.1.0 0.0.0.255 area 1
R1(config-router)#network 172.16.2.0 0.0.0.255 area 1
R1(config-router)#exit
 
R2
R2(config)#int s1/0
R2(config-if)#ip add 199.99.1.2 255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#int loop0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#exit
R2(config)#router ospf 100
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 199.99.1.0 0.0.0.255 area 0
R2(config-router)#exit
基本配置完成,然后我们来查看一下R2LSDB和路由表:
R2#show ip ospf database
 
            OSPF Router with ID (2.2.2.2) (Process ID 100)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         7           0x80000003 0x0043F4 2
2.2.2.2         2.2.2.2         7           0x80000001 0x00E352 2
 
                Summary Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
172.16.1.0      1.1.1.1         13          0x80000001 0x00E495
172.16.2.0      1.1.1.1         4           0x80000001 0x00D99F
 
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     172.16.0.0/24 is subnetted, 2 subnets
O IA    172.16.1.0 [110/65] via 199.99.1.1, 00:00:03, Serial1/0
O IA    172.16.2.0 [110/65] via 199.99.1.1, 00:00:03, Serial1/0
C    199.99.1.0/24 is directly connected, Serial1/0
好的,在R2上可以看到有两条区域外部路由,然后我们开始配置分配列表:
注意:在RIP,IGRP,EIGRP的路由协议中,分配列表的IN/OUT方向都可以配置,但是在ISISOSPF路由协议中,分配列表只能应用IN方向的
R2(config)#access-list 10 deny 172.16.1.0 0.0.0.255
R2(config)#access-list 10 permit any
R2(config)#router ospf 100
R2(config-router)#distribute-list 10 in
R2(config-router)#exit
先定义ACL禁止172.16.1.0/24的数据包通过,然后应用到OSPF中,方向为IN方向,配置完成后我们再看R2的路由表:
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     172.16.0.0/24 is subnetted, 1 subnets
O IA    172.16.2.0 [110/65] via 199.99.1.1, 00:00:02, Serial1/0
C    199.99.1.0/24 is directly connected, Serial1/0
确实没有172.16.1.0/24的路由条目了,再看一下LSDB有什么变化?
R2#show ip ospf database
 
            OSPF Router with ID (2.2.2.2) (Process ID 100)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         36          0x80000003 0x0043F4 2
2.2.2.2         2.2.2.2         35          0x80000001 0x00E352 2
 
                Summary Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
172.16.1.0      1.1.1.1         41          0x80000001 0x00E495
172.16.2.0      1.1.1.1         32          0x80000001 0x00D99F
没有任何变化,也就是说在链路状态路由协议中应用分配列表,只是当适当的路由从LSDB中选取出来放到路由表的时候过滤掉分配列表中定义过滤的路由,但是无法阻止LSDB的更新。
下面我们在R1上再起两个loopback接口,然后配置RIP路由协议,将RIP重发布到OSPF中,接着再配置分配列表来过滤掉不需要的路由:
R1(config)#int loop3
R1(config-if)#ip add 177.77.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#int loop4
R1(config-if)#ip add 177.77.2.1 255.255.255.0
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 177.77.1.0   
R1(config-router)#network 177.77.2.0
R1(config-router)#no auto-summary
R1(config-router)#exit
R1(config)#router ospf 100
R1(config-router)#redistribute rip subnets
R1(config-router)#exit
配置完成后再到R2上查看LSDB与路由表:
R2#show ip ospf database
 
            OSPF Router with ID (2.2.2.2) (Process ID 100)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         6           0x80000004 0x0047ED 2
2.2.2.2         2.2.2.2         66          0x80000001 0x00E352 2
 
                Summary Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
172.16.1.0      1.1.1.1         72          0x80000001 0x00E495
172.16.2.0      1.1.1.1         63          0x80000001 0x00D99F
 
                Type-5 AS External Link States
 
Link ID         ADV Router      Age         Seq#       Checksum Tag
177.77.1.0      1.1.1.1         5           0x80000001 0x001983 0
177.77.2.0      1.1.1.1         5           0x80000001 0x000E8D 0
 
R2#show ip route        
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     172.16.0.0/24 is subnetted, 1 subnets
O IA    172.16.2.0 [110/65] via 199.99.1.1, 00:00:01, Serial1/0
C    199.99.1.0/24 is directly connected, Serial1/0
     177.77.0.0/24 is subnetted, 2 subnets
O E2    177.77.1.0 [110/20] via 199.99.1.1, 00:00:01, Serial1/0
O E2    177.77.2.0 [110/20] via 199.99.1.1, 00:00:01, Serial1/0
成功学习到了自制系统外部路由。下面在R1上配置分配列表:
R1(config)#access-list 20 deny 177.77.1.0 0.0.0.255
R1(config)#access-list 20 permit any
R1(config)#router ospf 100
R1(config-router)#distribute-list 20 out rip
R1(config-router)#exit
首先定义ACL,禁止177.77.1.0/24的路由,然后应用到OSPF 100中,方向为OUT,然后查看R2LSDB与路由表:
R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
 
Gateway of last resort is not set
 
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     172.16.0.0/24 is subnetted, 1 subnets
O IA    172.16.2.0 [110/65] via 199.99.1.1, 00:00:23, Serial1/0
C    199.99.1.0/24 is directly connected, Serial1/0
     177.77.0.0/24 is subnetted, 1 subnets
O E2    177.77.2.0 [110/20] via 199.99.1.1, 00:00:23, Serial1/0
只剩下一条自治系统外部路由了;
R2#show ip ospf database
 
            OSPF Router with ID (2.2.2.2) (Process ID 100)
 
                Router Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         32          0x80000004 0x0047ED 2
2.2.2.2         2.2.2.2         92          0x80000001 0x00E352 2
 
                Summary Net Link States (Area 0)
 
Link ID         ADV Router      Age         Seq#       Checksum
172.16.1.0      1.1.1.1         98          0x80000001 0x00E495
172.16.2.0      1.1.1.1         89          0x80000001 0x00D99F
 
                Type-5 AS External Link States
 
Link ID         ADV Router      Age         Seq#       Checksum Tag
177.77.1.0      1.1.1.1         3603        0x80000002 0x004E61 0
177.77.2.0      1.1.1.1         31          0x80000001 0x000E8D 0
同样的LSDB没有任何变化,这也再次说明分配列表对LSDB没有任何影响!
最后我们用命令show ip protocols来查看一下两台路由器的路由协议配置情况:
R1#show ip protocols
Routing Protocol is "ospf 100"
  Outgoing update filter list for all interfaces is not set
    Redistributed rip filtered by 20
  Incoming update filter list for all interfaces is not set
  Router ID 1.1.1.1
  It is an area border and autonomous system boundary router
  Redistributing External Routes from,
    rip, includes subnets in redistribution
  Number of areas in this router is 2. 2 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    172.16.1.0 0.0.0.255 area 1
    172.16.2.0 0.0.0.255 area 1
    199.99.1.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 110)
上面用红色标记的是说重分布RIPOSPF中,并且过滤掉匹配ACL20的路由条目。
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 14 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface             Send  Recv  Triggered RIP  Key-chain
    Loopback3             2     2                                    
    Loopback4             2     2                                   
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    177.77.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 120)
 
R2#show ip protocols
Routing Protocol is "ospf 100"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is 10
  Router ID 2.2.2.2
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    199.99.1.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
    1.1.1.1              110      00:00:55
  Distance: (default is 110)
上面用红色标记的是说过滤掉匹配ACL10的,从所有接口进来的路由更新。

实验总结:掌握基本的分配列表的配置与重发布路由协议中应用分配列表的方法。

本文出自 “★Beckham~23” 博客,请务必保留此出处http://loveme23.blog.51cto.com/7891/49793





    文章评论
 
 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: