博客统计信息

51cto推荐博客
用户名:tiger506
文章数:183
评论数:286
访问量:188282
无忧币:223
博客积分:2959
博客等级:7
注册日期:2008-02-04

实验:基于源地址的策略路由
2008-11-20 03:11:32
版权声明:原创作品,如需转载,请与作者联系。否则将追究法律责任。
在上一篇笔记中,我说过马上作策略路由的实验吧~
现在将这个实验留在51CTO的博客吧~
 
实验目的:
根据不同来源地址的流量,通过策略路由选择不同的出口:
在这个实验中,源地址为211.141.1.0/24的数据必须经由R2的F0/0流出,经过R3再到达VMware PC 192.168.2.1;
在这个实验中,源地址为172.16.1.0/24的数据必须经由R2的F0/1流出,进过R1再到达VMware PC 192.168.2.1。
 
实验的硬件设施:
路由器 3台 2600系列
交换机 1台 3640系列
桥接虚拟机 1台 VMware XP系统
VPC 2台 DynamipsGUI自带
 
实验拓扑图:
 
硬件器材的物理连接:
Router1 F0/0 <----> Router2 F0/1
Router3 F0/0 <----> Router2 F0/0
VPCS V0/1 <----> Router2 E1/0
VPCS V0/2 <----> Router2 E1/1
Router1 F0/1 <----> Switch1 F0/14
Router3 F0/1 <----> Switch1 F0/15
XPC P0/0 <----> Switch1 F0/0
 
路由器R1的配置信息:
R1# sh run
Building configuration...
Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R1
!
!
memory-size iomem 15
ip subnet-zero
no ip domain-lookup
!
!
interface FastEthernet0/0
 ip address 172.17.1.1 255.255.255.0

 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.2.2 255.255.255.0

 speed 100
 full-duplex
!
router rip
 version 2
 network 172.17.0.0
 network 192.168.2.0
 no auto-summary

!
ip classless
no ip http server
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 transport input none
line aux 0
line vty 0 4
!
no scheduler allocate
end
路由器R2的主要配置(大家应该重点看看这里哦):
R2#sh run
Building configuration...
Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R2
!
!
memory-size iomem 15
ip subnet-zero
no ip domain-lookup
!
!
interface FastEthernet0/0
 ip address 172.17.2.1 255.255.255.0

 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 172.17.1.2 255.255.255.0

 duplex auto
 speed auto
!
interface Ethernet1/0
 ip address 211.141.1.254 255.255.255.0
 ip policy route-map ISP_R3
(将ROUTE-MAP应用在这个接口上,在该接口上检测源IP并将其从特定端口发送出去)
!
interface Ethernet1/1
 ip address 172.16.1.254 255.255.255.0
 ip policy route-map ISP_R1
(将ROUTE-MAP应用在这个接口上,在该接口上检测源IP并将其从特定端口发送出去)
!
interface Ethernet1/2
 no ip address
 shutdown
!
interface Ethernet1/3
 no ip address
 shutdown
!
router rip
 version 2
 network 172.16.0.0
 network 172.17.0.0
 network 211.141.1.0
 no auto-summary
!
ip classless
no ip http server
!
access-list 1 permit 211.141.1.0 0.0.0.255 (定义控制访问列表,在本实验中使用“标准”型,1-99)
access-list 2 permit 172.16.1.0 0.0.0.255
route-map ISP_R3 permit 10 
(定义路由映射表route-map,permit表示满足下列条件执行)
 
match ip address 1
 set interface FastEthernet0/0
!
route-map ISP_R1 permit 20
 match ip address 2
 set interface FastEthernet0/1
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 transport input none
line aux 0
line vty 0 4
!
no scheduler allocate
end
路由器R3的配置:
R3#sh run
Building configuration...
Current configuration:
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R3
!
!
memory-size iomem 15
ip subnet-zero
no ip domain-lookup
!
!
interface FastEthernet0/0
 ip address 172.17.2.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.2.3 255.255.255.0
 speed 100
 full-duplex
!
router rip
 version 2
 network 172.17.0.0
 network 192.168.2.0
 no auto-summary

!
ip classless
no ip http server
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
 transport input none
line aux 0
line vty 0 4
!
no scheduler allocate
end
 
模拟器自带VPC的配置信息:
 
桥接VMware虚拟机的配置信息:
 
实验结果检验:
1.在R2上看策略的配置情况,命令 sh ip policy
R2#sh ip policy
Interface      Route map
Ethernet1/0    ISP_R3
Ethernet1/1    ISP_R1
2.对比使用策略前后,VPC1和VPC2使用命令tracert到桥接虚拟机192.168.2.1的所行路径状况:
 使用策略前:
 
 使用策略后:
 
实验后记:
在配置完ROUTE-MAP后,要在源接口处进行应用才能生效,命令ip policy route-map map-tag。
这个实验中使用VMware虚拟机的主要原因是我们的电脑的防火墙设的太安全了,使用虚拟机方便。如果把本地防火墙安全调低,让远端机可以ping通或tracert本地机就可以了。
关于VM-WARE虚拟机的设置大家可以在网上找找资料。不难的。
                     

本文出自 “奋斗成就卓越” 博客,转载请与作者联系!

分享至
更多
一键收藏,随时查看,分享好友!
0人
了这篇文章
类别:路由技术圈()┆阅读()┆评论() ┆ 推送到技术圈返回首页

文章评论

 
2008-11-25 09:05:08
文章写的很好,再向博主提出以下建议:
1)只写关键配置、内容,并说明作用。
2)做好排版,使阅读轻松高效。
3)相信我这是善意的建议
博主回复:
2008-11-25 09:35:40
确实是这样~
以后我多向这方面努力!

2008-11-25 09:08:26
这是我认为你的博文的精华部分:

:: R2 ::

interface Ethernet1/0
ip address 211.141.1.254 255.255.255.0
ip policy route-map ISP_R3

interface Ethernet1/1
ip address 172.16.1.254 255.255.255.0
ip policy route-map ISP_R1

access-list 1 permit 211.141.1.0 0.0.0.255
access-list 2 permit 172.16.1.0 0.0.0.255

route-map ISP_R3 permit 10
match ip address 1
set interface FastEthernet0/0

route-map ISP_R1 permit 20
match ip address 2
set interface FastEthernet0/1
博主回复:
2008-11-25 09:34:42
这是重点!

 

发表评论            

【技术门诊】专家解析:软考重点难点及应试技巧
昵  称:
登录  快速注册
验证码:

请点击后输入验证码博客过2级,无需填写验证码

内  容: