ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

BGP/MPLS 虚拟专用网络 Option B

2020-12-18 17:57:32  阅读:276  来源: 互联网

标签:10.0 Option 0.0 MPLS BGP 255.255 ip mpls vpn


图一拓扑图

一、实验目的

1.配置BGP/MPLS 虚拟专用网络 Option B

二、BGP/MPLS 虚拟专用网络 Option B

1.底层路由协议可以配置为OSPF、ISIS等
2.利用MPLS为每条路由或每个实例分配一个标签,进行数据包的传输
3.利用BGP VPNv4传递私网路由
4.ASBR之间相连的接口,使能MPLS功能
5.ASBR之间建立BGP VPNv4关系

三、简单配置

1.CE_1

sysname CE_1
#
interface GigabitEthernet0/0/0
 ip address 10.0.12.1 255.255.255.0 
#
interface LoopBack1
 ip address 1.1.1.1 255.255.255.255 
#
ospf 1 
 area 0.0.0.0 
  network 1.1.1.1 0.0.0.0 
  network 10.0.12.0 0.0.0.255 
#
return

2.CE_2

sysname CE_2
#
interface GigabitEthernet0/0/0
 ip address 10.0.22.1 255.255.255.0 
#
interface LoopBack1
 ip address 9.9.9.9 255.255.255.255 
#
ospf 1 
 area 0.0.0.0 
  network 9.9.9.9 0.0.0.0 
  network 10.0.22.0 0.0.0.255 
#
return

3.PE_1

sysname PE_1
#
ip vpn-instance vpna
 ipv4-family
  route-distinguisher 1:1
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 import-extcommunity
#
ip vpn-instance vpnb
 ipv4-family
  route-distinguisher 2:1
  vpn-target 2:2 export-extcommunity
  vpn-target 2:2 import-extcommunity
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip binding vpn-instance vpna
 ip address 10.0.12.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.0.13.1 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet2/0/0
 ip binding vpn-instance vpnb
 ip address 10.0.22.2 255.255.255.0 
#
interface LoopBack1
 ip address 2.2.2.2 255.255.255.255 
#
bgp 100
 peer 4.4.4.4 as-number 100 
 peer 4.4.4.4 connect-interface LoopBack1
 #
 ipv4-family unicast
  undo synchronization
  peer 4.4.4.4 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 4.4.4.4 enable
 #
 ipv4-family vpn-instance vpna 
  import-route ospf 2
 #
 ipv4-family vpn-instance vpnb 
  import-route ospf 3
#
ospf 1 
 area 0.0.0.0 
  network 2.2.2.2 0.0.0.0 
  network 10.0.13.0 0.0.0.255 
#
ospf 2 vpn-instance vpna
 import-route bgp
 area 0.0.0.0 
  network 10.0.12.0 0.0.0.255 
#
ospf 3 vpn-instance vpnb
 import-route bgp
 area 0.0.0.0 
  network 10.0.22.0 0.0.0.255 
#
return

4.P_1

sysname P_1
#
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.0.14.1 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.0.13.2 255.255.255.0 
 mpls
 mpls ldp
#
interface LoopBack3
 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 10.0.13.0 0.0.0.255 
  network 10.0.14.0 0.0.0.255 
#
return

5.ASBR_PE1

sysname ASBR_PE1
#
ip vpn-instance vpna
 ipv4-family
  route-distinguisher 1:3
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 2:2 import-extcommunity
#
mpls lsr-id 4.4.4.4
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.0.14.2 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.0.15.1 255.255.255.0 
 mpls
#
interface LoopBack1
 ip address 4.4.4.4 255.255.255.255 
#
bgp 100
 peer 2.2.2.2 as-number 100 
 peer 2.2.2.2 connect-interface LoopBack1
 peer 10.0.15.2 as-number 200 
 #
 ipv4-family unicast
  undo synchronization
  peer 2.2.2.2 enable
  peer 10.0.15.2 enable
 # 
 ipv4-family vpnv4
  undo policy vpn-target
  peer 2.2.2.2 enable
  peer 10.0.15.2 enable
#
ospf 1 
 area 0.0.0.0 
  network 4.4.4.4 0.0.0.0 
  network 10.0.14.0 0.0.0.255 
#
return

6.ASBR_PE2

sysname ASBR_PE2
#
ip vpn-instance vpna
 ipv4-family
  route-distinguisher 1:4
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 2:2 import-extcommunity
#
ip vpn-instance vpnb
#
mpls lsr-id 5.5.5.5
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.0.16.1 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.0.15.2 255.255.255.0 
 mpls
#
interface LoopBack1
 ip address 5.5.5.5 255.255.255.255 
#
bgp 200
 peer 7.7.7.7 as-number 200 
 peer 7.7.7.7 connect-interface LoopBack1
 peer 10.0.15.1 as-number 100 
 #
 ipv4-family unicast
  undo synchronization
  peer 7.7.7.7 enable
  peer 10.0.15.1 enable
 # 
 ipv4-family vpnv4
  undo policy vpn-target
  peer 7.7.7.7 enable
  peer 10.0.15.1 enable
#
ospf 1 
 area 0.0.0.0 
  network 5.5.5.5 0.0.0.0 
  network 10.0.16.0 0.0.0.255 
#
return

7.P_2

sysname P_2
#
mpls lsr-id 6.6.6.6
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip address 10.0.16.2 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip address 10.0.17.1 255.255.255.0 
 mpls
 mpls ldp
#
interface LoopBack1
 ip address 6.6.6.6 255.255.255.255 
#
ospf 1 
 area 0.0.0.0 
  network 6.6.6.6 0.0.0.0 
  network 10.0.16.0 0.0.0.255 
  network 10.0.17.0 0.0.0.255 
#
return

8.PE_2

sysname PE_2
#
ip vpn-instance vpna
 ipv4-family
  route-distinguisher 1:2
  vpn-target 1:1 export-extcommunity
  vpn-target 1:1 import-extcommunity
#
ip vpn-instance vpnb
 ipv4-family
  route-distinguisher 2:2
  vpn-target 2:2 export-extcommunity
  vpn-target 2:2 import-extcommunity
#
mpls lsr-id 7.7.7.7
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/0
 ip binding vpn-instance vpna
 ip address 10.0.18.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.0.17.2 255.255.255.0 
 mpls
 mpls ldp
#
interface GigabitEthernet2/0/0
 ip binding vpn-instance vpnb
 ip address 10.0.23.2 255.255.255.0 
#
interface LoopBack1
 ip address 7.7.7.7 255.255.255.255 
#
bgp 200
 peer 5.5.5.5 as-number 200 
 peer 5.5.5.5 connect-interface LoopBack1
 #
 ipv4-family unicast
  undo synchronization
  peer 5.5.5.5 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 5.5.5.5 enable
 #
 ipv4-family vpn-instance vpna 
  import-route ospf 2
 #
 ipv4-family vpn-instance vpnb 
  import-route ospf 3
#
ospf 1 
 area 0.0.0.0 
  network 7.7.7.7 0.0.0.0 
  network 10.0.17.0 0.0.0.255 
#
ospf 2 vpn-instance vpna
 import-route bgp
 area 0.0.0.0 
  network 10.0.18.0 0.0.0.255 
#
ospf 3 vpn-instance vpnb
 import-route bgp
 area 0.0.0.0 
  network 10.0.23.0 0.0.0.255 
#
return

9.CE_3

sysname CE_3
#
interface GigabitEthernet0/0/0
 ip address 10.0.18.2 255.255.255.0 
#
interface LoopBack1
 ip address 8.8.8.8 255.255.255.255 
#
ospf 1 
 area 0.0.0.0 
  network 8.8.8.8 0.0.0.0 
  network 10.0.18.0 0.0.0.255 
#
return

10.CE_4

sysname CE_4
#
interface GigabitEthernet0/0/0
 ip address 10.0.23.1 255.255.255.0 
#
interface LoopBack1
 ip address 10.10.10.10 255.255.255.255 
#
ospf 1 
 area 0.0.0.0 
  network 10.0.23.0 0.0.0.255 
  network 10.10.10.10 0.0.0.0 
#
return

标签:10.0,Option,0.0,MPLS,BGP,255.255,ip,mpls,vpn
来源: https://blog.csdn.net/qq_44751470/article/details/111372616

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有