Configure a Hub-and-Spoke VPN Topology
This example shows how to set up a hub-and-spoke VPN configuration, which consists of the following components (see Figure 17):
- One hub PE router (Router D).
- One hub CE router connected to the hub PE router. For a hub-and-spoke VPN topology to function properly, there must be two interfaces connecting the hub PE router to the hub CE router, and each interface must have its own VRF table on the PE router:
- One interface (here, interface
ge-0/0/0.0) is used to announce spoke routes to the hub CE router. The VRF table associated with this interface contains the routes being announced by the spoke PE routers to the hub CE router.- The second interface (here, interface
ge-0/0/1.0) is used to receive route announcements from the hub CE that are destined for the hub-and-spoke routers. The VRF table associated with this interface contains the routes announced by the hub CE router to the spoke PE routers.
- Two spoke PE routers (Router E and Router F).
- Two spoke CE routers (CE1 and CE2), one connected to each spoke PE router.
- Label Distribution Protocol (LDP) as the signaling protocol.
![]()
In this configuration, route distribution from spoke CE Router CE1 occurs as follows:
- Spoke Router CE1 announces its routes to spoke PE Router E.
- Router E installs the routes from CE1 into its VRF table.
- After checking its VRF export policy, Router E adds the spoke target community to the routes from Router CE1 that passed the policy and announces them to the hub PE router, Router D.
- Router D checks the VRF import policy associated with interface
ge-0/0/0.0and places all routes from spoke PE routers that match the policy into itsbgp.l3vpnrouting table. (Any routes that do not match are discarded.)- Router D checks its VRF import policy associated with interface
ge-0/0/0.0and installs all routes that match into its spoke VRF table. The routes are installed with the spoke target community.- Router D announces routes to the hub CE over interface
ge-0/0/0.- The hub CE router announces the routes back to the hub PE Router D over the second interface to the hub router, interface
ge-0/0/1.- The hub PE router installs the routes learned from the hub CE router into its hub VRF table, which is associated with interface
ge-0/0/1.- The hub PE router checks the VRF export policy associated with interface
ge-0/0/1.0and announces all routes that match to all spokes after adding the hub target community.Figure 18 illustrates how routes are distributed from this spoke router to the other spoke CE router, Router CE2. The same path is followed if you issue a
traceroutecommand from Router CE1 to Router CE2.
![]()
The following sections explain how to configure the VPN functionality for a hub-and-spoke topology on the hub-and-spoke PE routers. The CE routers do not know about the VPN, so you configure them normally.
- Enable an IGP on the Hub-and-Spoke PE Routers
- Configure LDP on the Hub-and-Spoke PE Routers
- Configure IBGP on the PE Routers
- Configure Routing Instances for VPNs on the Hub-and-Spoke PE Routers
- Configure VPN Policy on the PE Routers
The final section in this example, Hub-and-Spoke VPN Configuration Summarized by Router, consolidates the statements needed to configure VPN functionality for each of the service provider routers shown in Figure 17.