Supported Platforms
Configuring Hub-and-Spoke VPN Topologies: One Interface
Use a one-interface configuration to advertise a default route from a hub or hubs.
Figure 1: Example of a Hub-and-Spoke VPN Topology with One Interface

Figure 1 illustrates a Layer 3 VPN hub-and-spoke application where there is only one interface between the hub CE (CE1) and the hub PE (PE1). This is the recommended way of configuring hub-and-spoke topologies.
In this configuration, a default route is advertised from the hub to the spokes. If more specific spoke CE routes need to be exchanged between spoke CE routers, then two interfaces are needed between the hub CE and hub PE. See Configuring Hub-and-Spoke VPN Topologies: Two Interfaces for a two-interface example.
In this configuration example, spoke route distribution is as follows:
- Spoke CE2 advertises its routes to spoke PE2.
- Spoke PE2 installs routes from CE2 into its VPN routing and forwarding (VRF) table.
- Spoke PE2 checks its VRF export policy, adds the route target community, and announces the routes to hub PE1.
- Hub PE1 checks its VRF import policy and installs routes that match the import policy into table bgp.l3vpn.0.
- Hub PE1 installs routes from table bgp.l3vpn.0 into the hub VRF table.
- Hub PE1 announces routes from the hub VRF table to the hub CE1.
In this configuration example, default route distribution is as follows:
- Hub CE1 announces a default route to hub PE1.
- Hub PE1 installs the default route into the hub VRF table.
- Hub PE1 checks its VRF export policy, adds the route target community and announces the default route to spoke PE2 and PE3.
- Spoke PE2 and PE3 check their VRF import policy and install the default route into table bgp.l3vpn.0.
- Spoke PE2 and PE3 install the routes from table bgp.l3vpn.0 into their spoke VRF tables.
- Spoke PE2 and PE3 announce the default route from the spoke VRF table to spoke CE2 and CE3.
The following sections describe how to configure a hub-and-spoke topology with one interface based on the topology illustrated in Figure 1:
Configuring Hub CE1
Configure hub CE1 as follows:
Configuring Hub PE1
Configure hub PE1 as follows:
Configuring the P Router
Configure the P Router as follows:
Configuring Spoke PE2
Configure spoke PE2 as follows:
Configuring Spoke PE3
Configure spoke PE3 as follows:
Configuring Spoke CE2
Configure spoke CE2 as follows:
Configuring Spoke CE3
Configure spoke CE3 as follows:
In this configuration example, traffic forwarding is as follows between spoke CE2 and hub CE1:
- Spoke CE2 forwards traffic using the default route learned
from spoke PE2 through BGP.
0.0.0.0/0 *[BGP/170] 02:24:15, localpref 100 AS path: 200 200 I > to 10.49.3.1 via t1-3/0/1.0
- Spoke PE2 performs a route lookup in the spoke VRF table
and forwards the traffic to hub PE2 (through the P router—PE2
pushes two labels) using the default route learned through BGP.
0.0.0.0/0 *[BGP/170] 01:35:45, localpref 100, from 10.255.14.176 AS path: 100 I > via t3-0/0/1.0, Push 100336, Push 100224(top)
- Hub PE1 does a route lookup in the mpls.0 table for the VPN label 100336.
100336 *[VPN/170] 01:37:03 > to 10.49.4.2 via t3-0/0/0.0, Pop
- Hub PE1 forwards the traffic out the interface t3-0/0/0.0 to hub CE1.
In this configuration example, traffic forwarding is as follows between hub CE1 and spoke CE2:
- Hub CE1 forwards traffic to the hub PE1 using the route
learned through BGP.
10.49.10.250/32 *[BGP/170] 02:28:46, localpref 100 AS path: 200 200 I > to 10.49.4.1 via t3-3/1/0.0
- Hub PE1 does a route lookup in the hub VRF table and forwards
the traffic to spoke PE2 (through the P router—PE1 pushes two
labels).
10.49.10.250/32 *[BGP/170] 01:41:05, localpref 100, from 10.255.14.182 AS path: 100 I > via t1-0/1/0.0, Push 100352, Push 100208(top)
- Spoke PE2 does a route lookup in the mpls.0 table for the VPN label 100352.
100352 *[VPN/170] 02:31:39 > to 10.49.3.2 via t1-0/1/2.0, Pop
- Spoke PE2 forwards the traffic out the interface t1-0/1/2.0 to spoke CE2.
In this configuration example, traffic forwarding is as follows between spoke CE2 and spoke CE3:
- Spoke CE2 forwards traffic using the default route learned
from spoke PE2 through BGP.
0.0.0.0/0 *[BGP/170] 02:24:15, localpref 100 AS path: 200 200 I > to 10.49.3.1 via t1-3/0/1.0
- Spoke PE2 does a route lookup in the spoke VRF table and
forwards the traffic to hub PE1 (through the P router—PE2 pushes
two labels) using the default route learned through BGP.
0.0.0.0/0 *[BGP/170] 01:35:45, localpref 100, from 10.255.14.176 AS path: 100 I > via t3-0/0/1.0, Push 100336, Push 100224(top)
- Hub PE1 does a route lookup in the mpls.0 table for the VPN label 100336.
100336 *[VPN/170] 01:37:03 > to 10.49.4.2 via t3-0/0/0.0, Pop
- Hub PE1 forwards the traffic out the interface t3-0/0/0.0 to the hub CE1.
- Hub CE1 forwards the traffic to hub PE1 using the router
learned through BGP.
10.49.10.253/32 *[BGP/170] 02:40:03, localpref 100 AS path: 200 200 I > to 10.49.4.1 via t3-3/1/0.0
- Hub PE1 does a route lookup in the hub VRF table and forwards
the traffic to spoke PE3 (through the P router—PE1 pushes two
labels).
10.49.10.253/32 *[BGP/170] 01:41:05, localpref 100, from 10.255.14.178 AS path: 100 I > via t1-0/1/0.0, Push 100128, Push 100192(top)
- Spoke PE3 does a route lookup in the mpls.0 table for VPN label 100128.
100128 *[VPN/170] 02:41:30 > to 10.49.6.2 via t3-0/0/0.0, Pop
- Spoke PE3 forwards the traffic out the interface t3-0/0/0.0 to spoke CE3.
If egress features are needed on the hub PE that require an IP forwarding lookup on the hub VRF routing table, see Enabling Egress Features on the Hub PE Router.
Enabling Egress Features on the Hub PE Router
This example is provided in conjunction with Configuring Hub-and-Spoke VPN Topologies: One Interface. This example also uses the topology illustrated in Figure 1.
If egress features are needed on the hub PE that require an IP forwarding lookup on the hub VRF routing table, the configuration detailed in Configuring Hub-and-Spoke VPN Topologies: One Interface will not work. Applying the vrf-table-label statement on the hub routing instance forces traffic from a remote spoke PE to be forwarded to the hub PE and forces an IP lookup to be performed. Because specific spoke routes are in the hub VRF table, traffic will be forwarded to a spoke PE without going through the hub CE.
The hub PE advertises the default route as follows, using VPN label 1028:
hub.inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) * 0.0.0.0/0 (1 entry, 1 announced) BGP group ibgp type Internal Route Distinguisher: 10.255.14.176:2 VPN Label: 1028 Nexthop: Self Localpref: 100 AS path: 100 I Communities: target:200:101
Incoming traffic is forwarded using VPN label 1028. The mpls.0 table shows that an IP lookup in the table hub.inet.0 is required:
1028 *[VPN/0] 00:00:27 to table hub.inet.0, Pop
However, the hub VRF table hub.inet.0 contains specific spoke routes:
10.49.10.250/32 *[BGP/170] 00:00:05, localpref 100, from 10.255.14.182 AS path: 100 I > via t1-0/1/0.0, Push 100352, Push 100208(top) 10.49.10.253/32 *[BGP/170] 00:00:05, localpref 100, from 10.255.14.178 AS path: 100 I > via t1-0/1/0.0, Push 100128, Push 100192(top)
Because of this, traffic is forwarded directly to the spoke PEs without going through the hub CE. To prevent this, you must configure a secondary routing instance for downstream traffic in the hub PE1.
Configuring Hub PE1
Configure hub PE1 as follows:
When the no-vrf-advertise statement is used at the [edit routing-instances hub] hierarchy level, no routing table groups or VRF export policies are required. The no-vrf-advertise statement configures the hub PE not to advertise VPN routes from the primary routing-instance hub. These routes are instead advertised from the secondary routing instance hub_downstream. See the routing instances configuration guidelines in the Junos OS Routing Protocols Configuration Guide for more information about the no-vrf-advertise statement.
The auto-export statement at the [edit routing-instances hub-downstream routing-options] hierarchy level identifies routes exported from the hub instance to the hub-downstream instance by looking at the route targets defined for each routing instance. See the routing instances configuration guidelines in the Junos OS Routing Protocols Configuration Guide for more information about using the auto-export statement. See Configuring Overlapping VPNs Using Automatic Route Export for more examples of export policy.
With this configuration on hub PE, spoke-to-spoke CE traffic goes through the hub CE and permits egress features (such as filtering) to be enabled on the hub PE.
In this configuration example, traffic forwarding is as follows between spoke CE2 and spoke CE3:
- Spoke CE2 forwards traffic using the default route learned
from spoke PE2 through BGP.
0.0.0.0/0 *[BGP/170] 02:24:15, localpref 100 AS path: 200 200 I > to 10.49.3.1 via t1-3/0/1.0
- Spoke PE2 does a route lookup in the spoke VRF table and
forwards the traffic to hub PE1 (through the P router—PE2 pushes
two labels) using the default route learned through BGP.
spoke.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[BGP/170] 00:00:09, localpref 100, from 10.255.14.176 AS path: 100 I > via t3-0/0/0.0, Push 1029, Push 100224(top)
- Hub PE1 does a route lookup in the mpls.0 table for the VPN label 1029.
mpls.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 1029 *[VPN/0] 00:11:49 to table hub_downstream.inet.0, Pop
The VPN label 1029 is advertised because:
- The vrf-table-label statement is applied at the [edit routing-instances hub_downsteam] hierarchy level in the hub PE1 configuration.
- The no-vrf-advertise statement is applied at the [edit routing-instances hub] hierarchy level, instructing the router to advertise the route from the secondary table.
Therefore, IP lookups are performed in the hub_downstream.inet.0 table, not in the hub.inet.0 table.
Issue the show route advertising-protocol command on the hub PE to a spoke PE to verify the VPN label 1029 advertisement:
user@host> show route advertising-protocol
hub_downstream.inet.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden) * 0.0.0.0/0 (1 entry, 1 announced) BGP group ibgp type Internal Route Distinguisher: 10.255.14.176:3 VPN Label: 1029 Nexthop: Self Localpref: 100 AS path: 100 I Communities: target:200:101
- Hub PE1 performs an IP lookup in the hub_downstream.inet.0 table and forwards the traffic out interface t3-0/0/0.0 to hub CE1.
hub_downstream.inet.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden) 0.0.0.0/0 (1 entry, 1 announced) *BGP Preference: 170/-101 Next-hop reference count: 4 Source: 10.49.4.2 Next hop: 10.49.4.2 via t3-0/0/0.0, selected State: <Secondary Active Ext> Peer AS: 100 Age: 3:03 Task: BGP_100.10.49.4.2+1707 Announcement bits (2): 0-KRT 2-BGP.0.0.0.0+179 AS path: 100 I Communities: target:200:101 Localpref: 100 Router ID: 10.49.10.251 Primary Routing Table hub.inet.0
The primary routing table is hub.inet.0, indicating that this route was exported from table hub.inet.0 into this hub_downstream.inet.0 table as a result of the no-vrf-advertise statement at the [edit routing-instances hub] hierarchy level and the auto-export statement at the [edit routing-instances hub-downstream routing-options] hierarchy level in the hub PE1 configuration.
- Hub CE1 forwards the traffic back to hub PE1 using the
router learned through BGP.
10.49.10.253/32 *[BGP/170] 02:40:03, localpref 100 AS path: 200 200 I > to 10.49.4.1 via t3-3/1/0.0
- Hub PE1 performs a route lookup in the hub VRF table and
forwards the traffic to spoke PE3 (through the P router—PE1
pushes two labels).
10.49.10.253/32 *[BGP/170] 01:41:05, localpref 100, from 10.255.14.178 AS path: 100 I > via t1-0/1/0.0, Push 100128, Push 100192(top)
- Spoke PE3 performs a route lookup in the mpls.0 table
for VPN label 100128.
100128 *[VPN/170] 02:41:30 > to 10.49.6.2 via t3-0/0/0.0, Pop
- Spoke PE3 forwards traffic out interface t3-0/0/0.0 to spoke CE3.