H3C Technologies H3C S12500-X Series Switches User Manual

Page 288

Advertising
background image

277

# Configure an LSR ID.

<ASBR1> system-view

[ASBR1] interface loopback 0

[ASBR1-LoopBack0] ip address 192.2.2.2 32

[ASBR1-LoopBack0] quit

[ASBR1] mpls lsr-id 192.2.2.2

# Enable L2VPN.

[ASBR1] l2vpn enable

# Enable global LDP.

[ASBR1] mpls ldp

[ASBR1-ldp] quit

# Configure VLAN-interface 23 connected to PE 1 and enable LDP on the interface.

[ASBR1] interface vlan-interface 23

[ASBR1-Vlan-interface23] ip address 23.1.1.2 24

[ASBR1-Vlan-interface23] mpls enable

[ASBR1-Vlan-interface23] mpls ldp enable

[ASBR1-Vlan-interface23] quit

# Configure VLAN-interface 26 connected to ASBR 2 and enable LDP on the interface.

[ASBR1] interface vlan-interface 26

[ASBR1-Vlan-interface26] ip address 26.2.2.2 24

[ASBR1-Vlan-interface26] mpls enable

[ASBR1-Vlan-interface26] quit

# Configure OSPF on ASBR 1 for LDP to create LSPs.

[ASBR1] ospf

[ASBR1-ospf-1] area 0

[ASBR1-ospf-1-area-0.0.0.0] network 23.1.1.2 0.0.0.255

[ASBR1-ospf-1-area-0.0.0.0] network 192.2.2.2 0.0.0.0

[ASBR1-ospf-1-area-0.0.0.0] quit

[ASBR1-ospf-1] quit

# Configure BGP to advertise labeled routes on ASBR1.

[ASBR1] bgp 100

[ASBR1-bgp] peer 26.2.2.3 as-number 200

[ASBR1-bgp] address-family ipv4 unicast

[ASBR1-bgp-ipv4] import-route direct

[ASBR1-bgp-ipv4] peer 26.2.2.3 enable

[ASBR1-bgp-ipv4] peer 26.2.2.3 route-policy policy1 export

[ASBR1-bgp-ipv4] peer 26.2.2.3 label-route-capability

[ASBR1-bgp-ipv4] quit

[ASBR1-bgp] quit

[ASBR1] route-policy policy1 permit node 1

[ASBR1-route-policy-policy1-1] apply mpls-label

[ASBR1-route-policy-policy1-1] quit

# Create a cross-connect group named vpn1, create a cross-connect named ldp in the group, and

create two LDP PWs for the cross-connect to form a multi-segment PW.

[ASBR1] xconnect-group vpn1

[ASBR1-xcg-vpn1] connection ldp

Advertising