Configuring BGP AS number substitution
Network requirements
As shown in Figure 83, CE 1 and CE 2 belong to VPN 1 and are connected to PE 1 and PE 2, respectively. The two CEs have the same AS number, 600.
Configure BGP AS number substitution on the PEs to enable the CEs to communicate with each other.
Figure 83: Network diagram
Table 24: Interface and IP address assignment
Device | Interface | IP address | Device | Interface | IP address |
---|---|---|---|---|---|
CE 1 | GE2/1/1 | 10.1.1.1/24 | P | Loop0 | 2.2.2.9/32 |
GE2/1/2 | 100.1.1.1/24 | GE2/1/1 | 20.1.1.2/24 | ||
PE 1 | Loop0 | 1.1.1.9/32 | GE2/1/2 | 30.1.1.1/24 | |
GE2/1/1 | 10.1.1.2/24 | PE 2 | Loop0 | 3.3.3.9/32 | |
GE2/1/2 | 20.1.1.1/24 | GE2/1/1 | 10.2.1.2/24 | ||
CE 2 | GE2/1/1 | 10.2.1.1/24 | GE2/1/2 | 30.1.1.2/24 | |
GE2/1/2 | 200.1.1.1/24 |
Configuration procedure
Configure basic MPLS L3VPN:
Configure OSPF on the MPLS backbone to allow the PEs and P device to learn the routes of the loopback interfaces from each other.
Configure basic MPLS and MPLS LDP on the MPLS backbone to establish LDP LSPs.
Establish MP-IBGP peer relationship between the PEs to advertise VPN IPv4 routes.
Configure the VPN instance of VPN 1 on PE 2 to allow CE 2 to access the network.
Configure the VPN instance of VPN 1 on PE 1 to allow CE 1 to access the network.
Configure BGP as the PE-CE routing protocol, and redistribute routes of CEs into PEs.
For more information about basic MPLS L3VPN configurations, see "Configuring basic MPLS L3VPN."
# Execute the display ip routing-table command on CE 2. The output shows that CE 2 has learned the route to network 10.1.1.0/24, where the interface used by CE 1 to access PE 1 resides. However, it has not learned the route to the VPN (100.1.1.0/24) behind CE 1.
<CE2> display ip routing-table Destinations : 17 Routes : 17 Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 10.1.1.0/24 BGP 255 0 10.2.1.2 GE2/1/1 10.2.1.0/24 Direct 0 0 10.2.1.1 GE2/1/1 10.2.1.0/32 Direct 0 0 10.2.1.1 GE2/1/1 10.2.1.1/32 Direct 0 0 127.0.0.1 InLoop0 10.2.1.255/32 Direct 0 0 10.2.1.1 GE2/1/1 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 200.1.1.0/24 Direct 0 0 200.1.1.1 GE2/1/2 200.1.1.0/32 Direct 0 0 200.1.1.1 GE2/1/2 200.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0 200.1.1.255/24 Direct 0 0 200.1.1.1 GE2/1/2 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0 255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
# Execute the display ip routing-table command on CE 1 to verify that CE 1 has not learned the route to the VPN behind CE 2. (Details not shown.)
# Execute the display ip routing-table vpn-instance command on the PEs. The output shows the route to the VPN behind the peer CE. This example uses PE 2.
<PE2> display ip routing-table vpn-instance vpn1 Destinations : 15 Routes : 15 Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 10.1.1.0/24 BGP 255 0 1.1.1.9 GE2/1/2 10.2.1.0/24 Direct 0 0 10.2.1.2 GE2/1/1 10.2.1.0/32 Direct 0 0 10.2.1.2 GE2/1/1 10.2.1.2/32 Direct 0 0 127.0.0.1 InLoop0 10.2.1.255/32 Direct 0 0 10.2.1.2 GE2/1/1 100.1.1.0/24 BGP 255 0 1.1.1.9 GE2/1/2 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 200.1.1.0/24 BGP 255 0 10.2.1.1 GE2/1/1 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0 255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
# Enable BGP update packet debugging on PE 2. The output shows that PE 2 advertises the route to 100.1.1.0/24, and the AS_PATH is 100 600.
<PE2> terminal monitor <PE2> terminal logging level 7 <PE2> debugging bgp update vpn-instance vpn1 10.2.1.1 ipv4 <PE2> refresh bgp all export ipv4 vpn-instance vpn1 *Jun 13 16:12:52:096 2012 PE2 BGP/7/DEBUG: -MDC=1; BGP.vpn1: Send UPDATE to peer 10.2.1.1 for following destinations: Origin : Incomplete AS Path : 100 600 Next Hop : 10.2.1.2 100.1.1.0/24,
# Execute the display bgp routing-table ipv4 peer received-routes command on CE 2 to verify that CE 2 has not received the route to 100.1.1.0/24.
<CE2> display bgp routing-table ipv4 peer 10.2.1.2 received-routes Total number of routes: 2 BGP local router ID is 200.1.1.1 Status codes: * - valid, > - best, d - dampened, h - history, s - suppressed, S - stale, i - internal, e - external Origin: i - IGP, e - EGP, ? - incomplete Network NextHop MED LocPrf PrefVal Path/Ogn * >e 10.1.1.0/24 10.2.1.2 0 100? * e 10.2.1.0/24 10.2.1.2 0 0 100?
Configure BGP AS number substitution on PE 2.
<PE2> system-view [PE2] bgp 100 [PE2-bgp-default] ip vpn-instance vpn1 [PE2-bgp-default-vpn1] peer 10.2.1.1 substitute-as [PE2-bgp-default-vpn1] address-family ipv4 unicast [PE2-bgp-default-ipv4-vpn1] peer 10.2.1.1 enable [PE2-bgp-default-ipv4-vpn1] quit [PE2-bgp-default-vpn1] quit [PE2-bgp-default] quit
Verifying the configuration
# The output shows that among the routes advertised by PE 2 to CE 2, the AS_PATH of 100.1.1.0/24 has changed from 100 600 to 100 100.
*Jun 13 16:15:59:456 2012 PE2 BGP/7/DEBUG: -MDC=1; BGP.vpn1: Send UPDATE to peer 10.2.1.1 for following destinations: Origin : Incomplete AS Path : 100 100 Next Hop : 10.2.1.2 100.1.1.0/24,
# Display again the routing information that CE 2 has received, and the routing table.
<CE2> display bgp routing-table ipv4 peer 10.2.1.2 received-routes Total number of routes: 3 BGP local router ID is 200.1.1.1 Status codes: * - valid, > - best, d - dampened, h - history, s - suppressed, S - stale, i - internal, e - external Origin: i - IGP, e - EGP, ? - incomplete Network NextHop MED LocPrf PrefVal Path/Ogn * >e 10.1.1.0/24 10.2.1.2 0 100? * e 10.2.1.0/24 10.2.1.2 0 0 100? * >e 100.1.1.0/24 10.2.1.2 0 100 100? <CE2> display ip routing-table Destinations : 18 Routes : 18 Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 10.1.1.0/24 BGP 255 0 10.2.1.2 GE2/1/1 10.2.1.0/24 Direct 0 0 10.2.1.1 GE2/1/1 10.2.1.0/32 Direct 0 0 10.2.1.1 GE2/1/1 10.2.1.1/32 Direct 0 0 127.0.0.1 InLoop0 10.2.1.255/32 Direct 0 0 10.2.1.1 GE2/1/1 100.1.1.0/24 BGP 255 0 10.2.1.2 GE2/1/1 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0 200.1.1.0/24 Direct 0 0 200.1.1.1 GE2/1/2 200.1.1.0/32 Direct 0 0 200.1.1.1 GE2/1/2 200.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0 200.1.1.255/32 Direct 0 0 200.1.1.1 GE2/1/2 224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0 224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0 255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
# After you also configure BGP AS substitution on PE 1, verify that the GigabitEthernet interfaces of CE 1 and CE 2 can ping each other. (Details not shown.)