VRF间的重分布
来源:互联网 发布:c语言for的用法 编辑:程序博客网 时间:2024/06/05 15:26
这篇博文将描述如何在一台路由器上使用VRF,双向重分布EIGRP路由。EIGRP在多个域中(这显然不是一个好的设计)。
这是一种在单台路由器重分布不同VRF间路由的方法,但路由协议不仅仅限于EIGRP,经笔者测试,EIGRP和EIGRP,OSPF和OSPF,EIGRP和OSPF之间的重分布都是没有问题的。本文仅为EIGRP为例进行演示。
拓扑如下:
基本配置如下:
R1(config)#int s1/1R1(config-if)#ip add 12.1.1.1 255.255.255.0R1(config-if)#no shutR1(config-if)#int lo 0R1(config-if)#ip add 1.1.1.1 255.255.255.0
R2(config)#int s1/0R2(config-if)#ip add 12.1.1.2 255.255.255.0R2(config-if)#no shutR2(config-if)#int s1/1R2(config-if)#ip add 23.1.1.2 255.255.255.0R2(config-if)#no shut
R3(config)#int s1/0R3(config-if)#ip add 23.1.1.3 255.255.255.0R3(config-if)#no shutR3(config-if)#int lo 0R3(config-if)#ip add 3.3.3.3 255.255.255.0
在R1和R3上启用分别启用EIGRP:
R1:
router eigrp 100 network 1.1.1.0 0.0.0.255 network 12.1.1.0 0.0.0.255 no auto-summary
R3:
router eigrp 200 network 3.3.3.0 0.0.0.255 network 23.1.1.0 0.0.0.255 no auto-summary
在R2上启用VRF,将S1/0接口划入"EIGRP100"的VRF,将S1/1接口划入"EIGRP200"的VRF,并启用EIGRP,分别与R1和R3建立邻居关系。
ip vrf EIGRP100 rd 100:100ip vrf EIGRP200 rd 200:200
interface Serial1/0 ip vrf forwarding EIGRP100 ip address 12.1.1.2 255.255.255.0interface Serial1/1 ip vrf forwarding EIGRP200 ip address 23.1.1.2 255.255.255.0
router eigrp 6000 no auto-summary ! address-family ipv4 vrf EIGRP200 network 23.1.1.0 0.0.0.255 //宣告路由 no auto-summary autonomous-system 200 //在VRF中一定要指定AS号,不然无法建立邻居 exit-address-family ! address-family ipv4 vrf EIGRP100 network 12.1.1.0 0.0.0.255 no auto-summary autonomous-system 100 exit-address-family
查看邻居关系
配置重分布:
在VRF中配置route-target的导入和导出,如果是多个VRF,一定要注意该项。
ip vrf EIGRP100
rd 100:100
route-target export 100:100
route-target import 200:200
!
ip vrf EIGRP200
rd 200:200
route-target export 200:200
route-target import 100:100
配置BGP,通过BGP来传递路由信息。
router bgp 5000
no synchronization
bgp router-id 2.2.2.2 //这里配置仅仅是确保BGP正常运行,路由器不需要有这个地址
bgp log-neighbor-changes
no auto-summary
!
address-family ipv4 vrf EIGRP200
redistribute eigrp 200
no auto-summary
no synchronization
exit-address-family
!
address-family ipv4 vrf EIGRP100
redistribute eigrp 100
no auto-summary
no synchronization
exit-address-family
配置完后,查看BGP表,查看路由是否已经被重分布进BGP中。
2#show ip bgp vpnv4 all
BGP table version is 13, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 100:100 (default for vrf EIGRP100)
*> 1.1.1.0/24 12.1.1.1 2297856 32768 ?
*> 3.3.3.0/24 23.1.1.3 2297856 32768 ?
*> 12.1.1.0/24 0.0.0.0 0 32768 ?
*> 23.1.1.0/24 0.0.0.0 0 32768 ?
Route Distinguisher: 200:200 (default for vrf EIGRP200)
*> 1.1.1.0/24 12.1.1.1 2297856 32768 ?
*> 3.3.3.0/24 23.1.1.3 2297856 32768 ?
*> 12.1.1.0/24 0.0.0.0 0 32768 ?
*> 23.1.1.0/24 0.0.0.0 0 32768 ?
配置EIGRP,将BGP的路由重分布进EIGRP。
router eigrp 6000
!
address-family ipv4 vrf EIGRP200
redistribute bgp 5000 metric 1000 100 255 1 1500
!
address-family ipv4 vrf EIGRP100
redistribute bgp 5000 metric 1000 100 255 1 1500
查看R1和R3的路由,分别是否学习到对方路由:
R1的路由表:
R1#show ip route
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
D EX 3.3.3.0 [170/3097600] via 12.1.1.2, 00:23:54, Serial1/1
23.0.0.0/24 is subnetted, 1 subnets
D EX 23.1.1.0 [170/3097600] via 12.1.1.2, 00:23:54, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1.0 is directly connected, Serial1/1
R3的路由表:
R3#show ip route
1.0.0.0/24 is subnetted, 1 subnets
D EX 1.1.1.0 [170/3097600] via 23.1.1.2, 00:24:06, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.1.1.0 is directly connected, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
D EX 12.1.1.0 [170/3097600] via 23.1.1.2, 00:24:06, Serial1/0
ping测试:
R1#ping 3.3.3.3 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/60/80 ms
有兴趣朋友可以了解更多java教程
- VRF间的重分布
- VRF间的重分布
- NAT的match-in-vrf功能介绍
- show ip vrf interfaces --check 检查接口加入的 vrf 配置
- 路由重分布笔记
- eigrp重分布实验
- 路由重分布概念
- HDFS的Block数据balancer重分布实战
- bgp/mpls vpn工程--- 加入vrf补丁后的问题
- Linux VRF(Virtual Routing Forwarding)的原理和实现
- Linux VRF(Virtual Routing Forwarding)的原理和实现
- show ip bgp ipv4 mvpn vrf LOCALSP neighbors 203.3.18.1 advertised-routes -------在特定的vrf show neighbo
- VRF技术
- show bgp vpnv4 unicast all neighbors 10.254.0.78 advertised-routes---邻居在特定的VRF里面,show 通告给这个特定的vrf邻居的
- Inter-VRF Routing with VRF Lite
- CCNP-EIGRP&OSPF重分布时开销metric值的计算过程
- ospf eigrp重分布和负载均衡
- heavy-tailed distribution(重尾分布)
- bzoj-2300 防线修建
- 网页时钟
- 《Python基础教程 (第2版 修订版)》 第2章 列表和元组(学习笔记· 一)
- POJ 2411 解题报告
- VLAN间通信之端到端模式
- VRF间的重分布
- 我来,然后,不去
- Cocos2d-x 3.0 触摸机制
- 我爱你,祖国
- 核心CISCO7609故障处理
- 静态路由
- leetcode 231 Power of Two(难易度:Easy)
- 家用轿车轮胎多久更换一次?
- java应用fullgc时如何排查问题