A PE and a CE can communicate using BGP, an IGP, or a static route.
Perform the following steps on the PE:
The system view is displayed.
The BGP view is displayed.
The BGP-VPN instance IPv4 address family view is displayed.
The CE is configured as a VPN peer.
The maximum number of hops allowed for the EBGP connection is specified.
Generally, EBGP peers are connected by a directly physical link. If no directly physical link is available, the peer ebgp-max-hop command must be used to allow EBGP peers to establish a multi-hop TCP connection.
The default value of hop-count is 255. If the maximum number of hops is set to 1, the PE cannot establish an EBGP connection with a peer if they are not directly connected.
The direct routes are advertised to the local CE.
The PE can automatically learn the direct routes destined for the local CE. The learned routes take precedence over the direct routes advertised from the local CE using EBGP. If this step is not performed, the PE does not use MP-BGP to advertise the direct routes destined for the local CE to the remote PE.
Routing loops are permitted.
The function of BGP AS number substitution is enabled.
In a scenario where VPN sites in the same site or those that have different private AS numbers communicate through the BGP/MPLS IP VPN backbone network, if a CE and its connected PE in a VPN site establish an EBGP connection, VPN routes from other VPN sites may carry the AS number of this VPN site. As a result, the CE discards the VPN routes, causing a failure in VPN site communication. To prevent this situation from occurring, run the peer substitute-as command on the PE to enable the AS number substitute function.
The configuration is committed.
Perform the following steps on the CE:
The system view is displayed.
The BGP view is displayed.
The PE is configured as a VPN peer.
The maximum number of hops allowed for the EBGP connection is specified.
Generally, EBGP peers are connected by a directly physical link. If no directly physical link is available, the peer ebgp-max-hop command must be used to allow EBGP peers to establish a multi-hop TCP connection.
The default value of hop-count is 255. If the maximum number of hops is set to 1, the PE cannot establish an EBGP connection with a peer if they are not directly connected.
Routes of the local site are imported.
The configuration is committed.