华为单域MPLS实验配置

公网网络互通

PE1:

ospf 1 router-id 1.1.1.1 
 area 0.0.0.0 
  network 1.1.1.1 0.0.0.0 
  network 100.1.1.1 0.0.0.0 



P:

ospf 1 router-id 2.2.2.2 
 area 0.0.0.0 
  network 2.2.2.2 0.0.0.0 
  network 100.1.1.2 0.0.0.0 
  network 100.1.2.2 0.0.0.0 



PE2:

ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 3.3.3.3 0.0.0.0 
  network 100.1.2.1 0.0.0.0 

PE与CE之间IP配置,创建VPN

PE1:

ip vpn-instance 1
 ipv4-family
#
ip vpn-instance 2
 ipv4-family

interface GigabitEthernet0/0/0
 ip binding vpn-instance 1
 ip address 192.168.1.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance 2
 ip address 192.168.1.1 255.255.255.0 



PE2:

ip vpn-instance 1
 ipv4-family
#
ip vpn-instance 2
 ipv4-family

interface GigabitEthernet0/0/0
 ip binding vpn-instance 1
 ip address 192.168.2.1 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip binding vpn-instance 2
 ip address 192.168.2.1 255.255.255.0 

 

PE、CE设备使用VPN配置私网路由

PE1:
ospf 100 router-id 1.1.1.1 vpn-instance 1
 area 0.0.0.0 
  network 192.168.1.1 0.0.0.0 
#
ospf 200 router-id 1.1.1.1 vpn-instance 2
 area 0.0.0.0 
  network 192.168.1.1 0.0.0.0 

CE1:
ospf 100 router-id 172.16.1.1 
 area 0.0.0.0 
  network 192.168.1.10 0.0.0.0 


CE2:
ospf 100 router-id 172.16.2.1 
 area 0.0.0.0 
  network 192.168.1.20 0.0.0.0 

PE2:
ospf 100 router-id 3.3.3.3 vpn-instance 1
 area 0.0.0.0 
  network 192.168.2.1 0.0.0.0 
#
ospf 200 router-id 3.3.3.3 vpn-instance 2
 area 0.0.0.0 
  network 192.168.2.1 0.0.0.0 

CE3:
ospf 100 router-id 172.16.3.1 
 area 0.0.0.0 
  network 192.168.2.10 0.0.0.0 


CE4:
ospf 100 router-id 172.16.4.1 
 area 0.0.0.0 
  network 192.168.2.20 0.0.0.0 

 

配置私网target

PE1:
ip vpn-instance 1
 ipv4-family
  route-distinguisher 1:1
  vpn-target 100:200 export-extcommunity
  vpn-target 100:100 import-extcommunity
#
ip vpn-instance 2
 ipv4-family
  route-distinguisher 2:2
  vpn-target 200:200 export-extcommunity
  vpn-target 200:100 import-extcommunity


PE2:
ip vpn-instance 1
 ipv4-family
  route-distinguisher 1:1
  vpn-target 100:100 export-extcommunity
  vpn-target 100:200 import-extcommunity
#
ip vpn-instance 2
 ipv4-family
  route-distinguisher 2:2
  vpn-target 200:100 export-extcommunity
  vpn-target 200:200 import-extcommunity

公网分配标签

PE1:
mpls lsr-id 1.1.1.1
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/2
 mpls
 mpls ldp

P:
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/1
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/2
 mpls
 mpls ldp

PE2:
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/1
 mpls
 mpls ldp

 配置MP-BGP,实现公网设备传递私网路由

PE1:
bgp 100
 peer 3.3.3.3 as-number 100 
 peer 3.3.3.3 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  undo peer 3.3.3.3 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 3.3.3.3 enable


PE2:
bgp 100
 peer 1.1.1.1 as-number 100 
 peer 1.1.1.1 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  undo peer 1.1.1.1 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 1.1.1.1 enable


双向引入

PE1:
bgp 100
 #
 ipv4-family vpn-instance 1 
  import-route ospf 100
 #
 ipv4-family vpn-instance 2 
  import-route ospf 200

ospf 100 
 import-route bgp
ospf 200 
 import-route bgp

PE2:
bgp 100
 #
 ipv4-family vpn-instance 1 
  import-route ospf 100
 #
 ipv4-family vpn-instance 2 
  import-route ospf 200

ospf 100 
 import-route bgp
ospf 200 
 import-route bgp

 

 验证:

  • 0
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值