• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

VRF Selection using by source ip

发布: 2007-6-23 19:14 | 作者:   | 来源:   | 查看: 17次 | 进入软件测试论坛讨论

领测软件测试网

   

使用了这个feature后,就不需要在接口上应用ip vrf forwarding了,pe会根据上来数据包的源地址把数据包划分到相应的vrf中,当然这样做带来了方便,但性能上的下降也相当大。还有一种方法就是用route-map来实现vrf selection,这样更灵活,甚至可以根据ip precedence来划分vrf了。不过cisco的ios没有同时支持使用source ip和route-map做vrf selection的。

VRF Selection using by source ip

R1
hostname R1
!
interface Loopback10
description SiteA
ip address 172.16.10.1 255.255.255.255
no ip directed-broadcast
!
interface Loopback20
description SiteB
ip address 172.16.20.1 255.255.255.255
no ip directed-broadcast
!
interface Ethernet1/2
ip address 192.168.12.1 255.255.255.0
no ip directed-broadcast
full-duplex
!
ip route 0.0.0.0 0.0.0.0 192.168.12.2

R2
hostname R2
!
ip cef
ip vrf SiteA
rd 100:100
route-target export 100:100
route-target import 100:100
!        
ip vrf SiteB
rd 100:200
route-target export 100:200
route-target import 100:200
!
mpls label protocol ldp
vrf selection source 172.16.10.0 255.255.255.0 vrf SiteA
vrf selection source 172.16.20.0 255.255.255.0 vrf SiteB
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
no ip directed-broadcast
!
interface Ethernet1/1
ip vrf select source
ip vrf receive SiteA
ip vrf receive SiteB
ip address 192.168.12.2 255.255.255.0
no ip directed-broadcast
full-duplex
!
interface Ethernet1/3
ip address 192.168.23.2 255.255.255.0
no ip directed-broadcast
full-duplex
tag-switching ip
!        
router ospf 100
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 192.168.23.0 0.0.0.255 area 0
!
router bgp 100
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
neighbor 4.4.4.4 remote-as 100
neighbor 4.4.4.4 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 4.4.4.4 activate
neighbor 4.4.4.4 send-community both
exit-address-family
!
address-family ipv4 vrf SiteB
redistribute static
no synchronization
exit-address-family
!
address-family ipv4 vrf SiteA
redistribute static
no synchronization
exit-address-family
!
ip route vrf SiteA 172.16.10.1 255.255.255.255 192.168.12.1
ip route vrf SiteB 172.16.20.1 255.255.255.255 192.168.12.1
!
tag-switching tdp router-id Loopback0

R3
hostname R3
!
ip cef
mpls label protocol ldp
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
no ip directed-broadcast
!
interface Ethernet1/2
ip address 192.168.23.3 255.255.255.0
no ip directed-broadcast
full-duplex
tag-switching ip
!
interface Ethernet1/4
ip address 192.168.34.3 255.255.255.0
no ip directed-broadcast
full-duplex
tag-switching ip
!
router ospf 100
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 192.168.23.0 0.0.0.255 area 0
network 192.168.34.0 0.0.0.255 area 0
!
tag-switching tdp router-id Loopback0

R4
hostname R4
!
ip cef
ip vrf SiteA
rd 100:100
route-target export 100:100
route-target import 100:100
!        
ip vrf SiteB
rd 100:200
route-target export 100:200
route-target import 100:200
!
mpls label protocol ldp
vrf selection source 172.16.10.0 255.255.255.0 vrf SiteA
vrf selection source 172.16.20.0 255.255.255.0 vrf SiteB
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
no ip directed-broadcast
!
interface Ethernet1/3
ip address 192.168.34.4 255.255.255.0
no ip directed-broadcast
full-duplex
tag-switching ip
!
interface Ethernet1/5
ip vrf select source
ip vrf receive SiteA
ip vrf receive SiteB
ip address 192.168.45.4 255.255.255.0
no ip directed-broadcast
full-duplex
!
router ospf 100
router-id 4.4.4.4
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 192.168.34.0 0.0.0.255 area 0
!
router bgp 100
no synchronization
bgp router-id 4.4.4.4
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 send-community both
exit-address-family
!
address-family ipv4 vrf SiteB
redistribute static
no synchronization
exit-address-family
!
address-family ipv4 vrf SiteA
redistribute static
no synchronization
exit-address-family
!
ip route vrf SiteA 172.16.10.5 255.255.255.255 192.168.45.5
ip route vrf SiteB 172.16.20.5 255.255.255.255 192.168.45.5
!
tag-switching tdp router-id Loopback0

R5
hostname R5
!
interface Loopback10
description SiteA
ip address 172.16.10.5 255.255.255.255
no ip directed-broadcast
!
interface Loopback20
description SiteB
ip address 172.16.20.5 255.255.255.255
no ip directed-broadcast
!
interface Ethernet1/4
ip address 192.168.45.5 255.255.255.0
no ip directed-broadcast
full-duplex
!        
ip route 0.0.0.0 0.0.0.0 192.168.45.4

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网