华为 三层 EVPN实验

1 需求说明

在网络中配置三层EVPN功能,实现三层流量互访:

  1. PC1的网关为192.168.10.254/24
  2. PC2的网关为192.168.20.254/24
  3. L3VPN实例名称为 A

2 实验拓扑

在这里插入图片描述

3 配置步骤

  1. 在骨干网上配置ospf IGP实现各个PE设备之间的互通
  2. 在骨干网上配置MPLS基本能力和MPLS LDP,建立MPLS LSP。
  3. 配置PE上的L3VPN实例 A
  4. 配置建立PE之间的BGP EVPN对等体关系。
  5. 配置CE接入PE,在pe的bgp vpn路由里面引入发布路由。
  6. 配置结果验证。

4 配置文件

PE1的配置文件

sysname PE1
undo dcn	关闭不需要的功能
ip vpn-instance A	配置L3 VPN实例,并使能evpn路由
 ipv4-family
  route-distinguisher 10:10
  vpn-target 10:10 both evpn
  evpn mpls routing-enable
mpls lsr-id 1.1.1.1
mpls
mpls ldp
interface Ethernet1/0/0
 ip binding vpn-instance A
 ip address 192.168.10.254 255.255.255.0
interface Ethernet1/0/1
 ip address 13.1.1.1 255.255.255.0
 mpls
 mpls ldp
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255
bgp 100
 peer 2.2.2.2 as-number 100
 peer 2.2.2.2 connect-interface LoopBack0
 ipv4-family vpn-instance A	引入路由到BGP,并宣告的evpn里面
  import-route direct
  advertise l2vpn evpn
 l2vpn-family evpn	与对端PE建立evpn对等体
  peer 2.2.2.2 enable
ospf 1
 area 0.0.0.0
  network 1.1.1.1 0.0.0.0
  network 13.1.1.1 0.0.0.0

RT3的配置文件

sysname RT1
mpls lsr-id 3.3.3.3
mpls
mpls ldp
interface GigabitEthernet0/0/0
 ip address 13.1.1.3 255.255.255.0 
 mpls
 mpls ldp
interface GigabitEthernet0/0/1
 ip address 23.1.1.3 255.255.255.0 
 mpls
 mpls ldp
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255 
ospf 1 
 area 0.0.0.0 
  network 3.3.3.3 0.0.0.0 
  network 13.1.1.3 0.0.0.0 
  network 23.1.1.3 0.0.0.0 

PE2的配置文件

sysname PE2
undo dcn
ip vpn-instance A
 ipv4-family
  route-distinguisher 10:10
  vpn-target 10:10 both evpn
  evpn mpls routing-enable
mpls lsr-id 2.2.2.2
mpls
mpls ldp
interface Ethernet1/0/0
 ip address 23.1.1.2 255.255.255.0
 mpls
 mpls ldp
interface Ethernet1/0/1
 ip binding vpn-instance A
 ip address 192.168.20.254 255.255.255.0
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255
bgp 100
 peer 1.1.1.1 as-number 100
 peer 1.1.1.1 connect-interface LoopBack0
 ipv4-family vpn-instance A
  import-route direct
  advertise l2vpn evpn
 l2vpn-family evpn
  peer 1.1.1.1 enable
ospf 1
 area 0.0.0.0
  network 2.2.2.2 0.0.0.0
  network 23.1.1.2 0.0.0.0

PC的配置文件

在这里插入图片描述

5 查看状态

5.1 查看evpn邻居关系

与对端PE2建立BGP EVPN 对等体

[PE1]dis bgp evpn peer 
 
 BGP local router ID : 13.1.1.1
 Local AS number : 100
 Total number of peers : 1                 Peers in established state : 1

  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State  PrefRcv
  2.2.2.2         4         100       58       58     0 00:46:50 Established        1

5.2 查看vpn实例的路由

可以看到从对端PE2学习来的 192.168.20.0/24 网段的路由信息

[PE1]display ip routing-table vpn-instance A
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole
 route
------------------------------------------------------------------------------
Routing Table : A
         Destinations : 6        Routes : 6         

Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0             D   127.0.0.1       InLoopBack0
   192.168.10.0/24  Direct  0    0             D   192.168.10.254  Ethernet1/0/0
 192.168.10.254/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/0
 192.168.10.255/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/0
   192.168.20.0/24  IBGP    255  0             RD  2.2.2.2         Ethernet1/0/1
255.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值