AR100-S, AR110-S, AR120-S, AR150-S, AR160-S, AR200-S, AR1200-S, AR2200-S, and AR3200-S CLI-based Typical Configuration Examples
Example for Configuring BGP/MPLS IP VPN to Implement Communication Between Devices (Running Static Routes Between the PEs and CEs)
Applicability
This example applies to all versions.
The AR100-S&AR110-S&AR120-S&AR160-S series do not support this function.
Networking Requirements
PE1 connects to CE1, PE2 connects to CE2, CE1 and CE2 belong to vpn1, and PEs and CEs use static routes to communicate.
Figure 6-62 Networking diagram for configuring BGP/MPLS IP VPN
Procedure
- Configure CE1.
# sysname CE1 # interface GigabitEthernet0/0/1 ip address 10.1.1.2 255.255.255.0 # interface GigabitEthernet1/0/0 ip address 10.137.1.1 255.255.255.0 # ip route-static 0.0.0.0 0.0.0.0 10.1.1.1 # return
- Configure CE2.
# sysname CE2 # interface GigabitEthernet0/0/1 ip address 10.1.2.2 255.255.255.0 # interface GigabitEthernet1/0/0 ip address 10.137.2.1 255.255.255.0 # ip route-static 0.0.0.0 0.0.0.0 10.1.2.1 # return
- Configure PE1.
# sysname PE1 # ip vpn-instance vpn1 //Create a VPN instance. ipv4-family route-distinguisher 1:1 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity # mpls lsr-id 1.1.1.1 //Configure MPLS. mpls # mpls ldp # interface GigabitEthernet0/0/1 ip address 192.168.1.1 255.255.255.0 mpls mpls ldp //Enable MPLS on the interface at the public network side. # interface GigabitEthernet1/0/0 ip binding vpn-instance vpn1 //Bind the interface to the VPN instance. ip address 10.1.1.1 255.255.255.0 # 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 //Use the loopback interface address with 32-bit mask to establish an MP-IBGP peer relationship. # ipv4-family unicast undo synchronization peer 2.2.2.2 enable # ipv4-family vpnv4 //Enable the local node to exchange VPNv4 routing information with the peer. policy vpn-target peer 2.2.2.2 enable # ipv4-family vpn-instance vpn1 import-route static //Import static routes. # ospf 1 //Enable OSPF to advertise routes to the loopback interface. area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 192.168.1.0 0.0.0.255 # ip route-static vpn-instance vpn1 10.137.1.0 255.255.255.0 10.1.1.2 # return
- Configure PE2.
# sysname PE2 # ip vpn-instance vpn1 //Create a VPN instance. ipv4-family route-distinguisher 1:1 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity # mpls lsr-id 2.2.2.2 //Configure MPLS. mpls # mpls ldp # interface GigabitEthernet0/0/1 ip address 192.168.1.2 255.255.255.0 mpls mpls ldp //Enable MPLS on the interface at the public network side. # interface GigabitEthernet1/0/0 ip binding vpn-instance vpn1 //Bind the interface to the VPN instance. ip address 10.1.2.1 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 //Use the loopback interface address with 32-bit mask to establish an MP-IBGP peer relationship. # ipv4-family unicast undo synchronization peer 1.1.1.1 enable # ipv4-family vpnv4 //Enable the local node to exchange VPNv4 routing information with the peer. policy vpn-target peer 1.1.1.1 enable # ipv4-family vpn-instance vpn1 import-route static //Import static routes. # ospf 1 //Enable OSPF to advertise routes to the loopback interface. area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 2.2.2.2 0.0.0.0 # ip route-static vpn-instance vpn1 10.137.2.0 255.255.255.0 10.1.2.2 # return
- Verify the configuration.
# Run the display ip routing-table vpn-instance vpn1 command on PEs. The VPN routing table on the local PE has a route to the peer PE. CE2 can ping IP address 10.137.1.1 and CE1 can ping IP address 10.137.2.1.
# Use the display on PE1 as an example.
Destination/Mask Proto Pre Cost Flags NextHop Interface 10.1.2.0/24 IBGP 255 0 RD 2.2.2.2 GigabitEthernet 0/0/1 10.137.2.0/24 IBGP 255 20 RD 2.2.2.2 GigabitEthernet 0/0/1
# Use the display on PE2 as an example.
Destination/Mask Proto Pre Cost Flags NextHop Interface 10.1.1.0/24 IBGP 255 0 RD 1.1.1.1 GigabitEthernet 0/0/1 10.137.1.0/24 IBGP 255 20 RD 1.1.1.1 GigabitEthernet 0/0/1
Document ID:EDOC1000138063
Views:754852
Downloads:2681
Average rating:4.8Points