1 拓扑

2 配置步骤
2.1 配置接口IP 和静态路由
PE1
interface LoopBack 0
 ip address 1.1.1.9 32 
 quit
interface GigabitEthernet 1/0
 ip address 10.1.1.1 255.255.255.0
 quit
 
ip route-static 2.2.2.9 32 10.1.1.2
ip route-static 3.3.3.9 32 10.1.1.2P
interface LoopBack 0
 ip address 2.2.2.9 32 
 quit
interface GigabitEthernet 1/0
 ip address 10.1.1.2 255.255.255.0
 quit
interface GigabitEthernet 2/0
 ip address 20.1.1.1 255.255.255.0
 quit
ip route-static 1.1.1.9 32 10.1.1.1
ip route-static 3.3.3.9 32 20.1.1.2PE2
interface LoopBack 0
 ip address 3.3.3.9 32 
 quit
interface GigabitEthernet 1/0
 ip address 20.1.1.2 255.255.255.0
 quit
ip route-static 1.1.1.9 32 20.1.1.1
ip route-static 2.2.2.9 32 20.1.1.1VPC1
ip 11.1.1.100/24VPC2
ip 11.1.1.200/24查看路由表

2.2 配置MPLS LSP
PE1
mpls lsr-id 1.1.1.9
 
interface GigabitEthernet 1/0
 mpls enable
 quit
static-lsp ingress 1to2 destination 3.3.3.9 32 nexthop 10.1.1.2 out-label 30
static-lsp egress 2to1 in-label 60P
mpls lsr-id 2.2.2.9
 
interface GigabitEthernet 1/0
 mpls enable
 quit
interface GigabitEthernet 2/0
 mpls enable 
 quit
static-lsp transit 1to2 in-label 30 nexthop 20.1.1.2 out-label 50
static-lsp transit 2to1 in-label 40 nexthop 10.1.1.1 out-label 60PE2
mpls lsr-id 3.3.3.9
interface GigabitEthernet 1/0
 mpls enable
 quit
static-lsp egress 1to2 in-label 50
static-lsp ingress 2to1 destination 1.1.1.9 32 nexthop 20.1.1.1 out-label 40查看 LSP

2.3 配置L2VPN BGP
PE1
l2vpn enable
bgp 100
 peer 3.3.3.9 as-number 100
 peer 3.3.3.9 connect-interface loopback 0
 address-family l2vpn
  peer 3.3.3.9 enable
  quit
 quitPE2
l2vpn enable
bgp 100
 peer 1.1.1.9 as-number 100
 peer 1.1.1.9 connect-interface loopback 0
 address-family l2vpn
  peer 1.1.1.9 enable
  quit
 quit查看bgp 状态

2.4 配置 xconnect-group
PE1
xconnect-group vpna
 auto-discovery bgp
  route-distinguisher 2:2
  vpn-target 2:2 export-extcommunity
  vpn-target 2:2 import-extcommunity
  site 1 range 10 default-offset 0
   connection remote-site-id 2
    ac interface GigabitEthernet 2/0
    quit
   quit
  quit
 quitPE2
xconnect-group vpna
 auto-discovery bgp
  route-distinguisher 2:2
  vpn-target 2:2 export-extcommunity
  vpn-target 2:2 import-extcommunity
  site 2 range 10 default-offset 0
   connection remote-site-id 1
    ac interface GigabitEthernet 2/0
    quit
   quit
  quit
 quit查看PW

2.5 验证L2VPN
 


















