vrf路由泄露原理和简单示例

来源:互联网 发布:软件服务外包方案 编辑:程序博客网 时间:2024/05/15 23:52

    通过简单示例讲解一下vrf泄露的方法

前提

1、在思科设备里面称为vrf。
2、在华为设备里面称为vpn-instance。

一、原理

需求:vpn-a访问vpn-b

vpn-instance有2个vpn-a和vpn-b。1.1.1.1/24在vpn-b里面,需要从vpn-a去访问vpn-b里面1.1.1.1/24。

1、方法一: 出方向接口是“出接口” (接口E0/0/0属于vpn-b)

这里写图片描述

方法二:出方向接口是“vrf” (vpn-b)

这里写图片描述

二、示例

需求:使R2和R3可以互通

1、拓扑

这里写图片描述

2、配置

1)R1:

interface Vlanif102 ip binding vpn-instance vpn-a ip address 12.1.1.1 255.255.255.0interface Vlanif103 ip binding vpn-instance vpn-b ip address 13.1.1.1 255.255.255.0
interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 2 to 4094interface GigabitEthernet0/0/2             port link-type trunk port trunk allow-pass vlan 2 to 4094
ip route-static vpn-instance vpn-a 13.1.1.0 255.255.255.0 vpn-instance vpn-b 13.1.1.3ip route-static vpn-instance vpn-b 12.1.1.0 255.255.255.0 Vlanif102 12.1.1.2

2)R2:

interface Vlanif102 ip address 12.1.1.2 255.255.255.0interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 2 to 4094
ip route-static 0.0.0.0 0.0.0.0 Vlanif102 12.1.1.1

3)R3:

interface Vlanif103 ip address 13.1.1.3 255.255.255.0interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 2 to 4094
ip route-static 0.0.0.0 0.0.0.0 Vlanif103 13.1.1.1

3、结果

这里写图片描述

0 0