11 mins read

L3VPN – Hub & Spoke VPN: One Interface

1. Intro

In an MPLS L3VPN, Hub-and-Spoke is a VPN topology where spoke sites cannot communicate directly with each other. Traffic between spokes must pass through the hub PE/site. This is commonly used when the hub provides centralized firewalling, Internet access, shared services, security inspection, or centralized routing.

The are two main categories for configuring a Hub & Spoke VPN:

  • One-interface H&S
  • Two-interfaces H&S

In this post we will focus on the One-interface H&S model. For the Two-interface H&S model visit the next post.

One-Interface H&S VPN:

  • only one interface between Hub-CE and Hub-PE
  • only a default route is advertised from the hub to the spokes
  • limitation: if more specific routes must be exchanged through the hub or between spokes, then the two-interfaces model is needed.
  • this is the option that is recommended by Juniper.
  • limitation: with label forwarding at the hub (no IP forwarding lookup), we can’t have egress features.

In our scenario we have a customer, we will call it ‘HS‘ customer, and it wants a Hub & Spoke VPN (with one interface at the hub), the topology is the following:

The logic is not that complicated:

  • We will use two Route Targets
  • One Route Target will be exported by the Spoke VRF, which will then be imported at the Hub VRF.
  • The other Route Target will be exported by the HUB VRF, which will then be imported by Spoke VRF.
  • Traffic originated by the Spokes will use the default route originated by the HUB CE for forwarding.
  • The catch, we must not configure vrf-table-label at the HUB VRF, this will send any Spoke packet to HUB CE.

If we translate this to Route Targets, it will look like this:

  • VRF Spoke
    • vrf-export target:64512:302
    • vrf-import target:64512:301
  • VRF Hub
    • vrf-import target:64512:302
    • vrf-export target:64512:301
    • interface ge-0/0/4.311 (PE-CE)
    • don’t configure vrf-table-label

2. Configuring H&S VPN

Considering the details from the introduction, let’s see the configuration:

Note: We use as-override to overcome the AS loop prevention issue we typically have when using the same AS on all customers sites,

Now let’s see how the R8 to R7 advertisements (via the HUB):

How can we use the default route instead of the more specific route to R7? This will work because we are missing the vrf-table-label configuration on the HUB PE VRF. Instead of striping off the VPN label and doing an IP lookup, the HUB PE will use the VPN label to just forward any packet directly to the CE, skipping the IP lookup.

### Notice the VPN Label: 

root@R1# run show route advertising-protocol bgp 17.0.0.4 table HS-HUB.inet.0 0/0 exact detail 

HS-HUB.inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
* 0.0.0.0/0 (1 entry, 1 announced)
 BGP group iBGP type Internal
     Route Distinguisher: 17.0.0.1:310
     VPN Label: 49
     Nexthop: Self
     Flags: Nexthop Change
     Localpref: 100
     AS path: [100] 64512 I 
     Communities: target:64512:301

root@R8# run show route table HS-SPOKE.inet.0 192.168.7.1 extensive | match "Label operation:"
                Label operation: Push 49, Push 801001(top)
                Label operation: Push 49
                        Label operation: Push 49

### VPN label 49 action is POP and forward to ge-0/0/4.311 (HUB CE interface): 

root@R1# run show route table mpls.0 label 49 

mpls.0: 30 destinations, 30 routes (30 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

49                 *[VPN/170] 00:01:44
                    >  to 172.16.0.1 via ge-0/0/4.311, Pop 

### HUB CE will receive the packet (with no label) and send it back to the PE: 

root@R9# run show route 192.168.7.1 logical-system HS-HUB    

inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

192.168.7.0/24     *[BGP/170] 02:37:34, localpref 100
                      AS path: 100 100 I, validation-state: unverified
                    >  to 172.16.0.0 via ge-0/0/1.311

### This time the HUB PE will make an IP lookup, and will use the route to R7: 

root@R1# run show route table HS-HUB.inet.0 192.168.7.1 

HS-HUB.inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

192.168.7.0/24     *[BGP/170] 02:54:44, localpref 100, from 17.0.0.4
                      AS path: 64512 I, validation-state: unverified
                    >  to 17.1.3.3 via ge-0/0/2.0, Push 38, Push 801007(top)

### At this point this is normal VPN forwarding.
### Ping from R8 to R7 is working: 

root@R9# run ping 192.168.7.1 source 192.168.8.1 logical-system HS-CE-R8 rapid count 10000    
PING 192.168.7.1 (192.168.7.1): 56 data bytes
!!!!!!!!!!!!!!!!!!!!!!!!

### The interface (HUB-CE to HUB-PE interface) counters are showing that traffic is going via the HUB-PE: 

root@R1# run monitor interface ge-0/0/4.311    

Interface: ge-0/0/4.311, Enabled, Link is Up
Flags: SNMP-Traps 0x4000
Encapsulation: ENET2
VLAN-Tag [ 0x8100.311 ]
Local statistics:                                                Current delta
  Input bytes:                     55092                                   [0]
  Output bytes:                    68956                                   [0]
  Input packets:                     893                                   [0]
  Output packets:                    865                                   [0]
Remote statistics:
  Input bytes:                   1087128 (123688 bps)                 [156324]
  Output bytes:                  1087128 (123688 bps)                 [156324]
  Input packets:                   12942 (184 pps)                      [1861]
  Output packets:                  12942 (184 pps)                      [1861]
Traffic statistics:
  Input bytes:                   1142220                              [156324]
  Output bytes:                  1156084                              [156324]
  Input packets:                   13835                                [1861]
  Output packets:                  13807                                [1861]
Protocol: inet, MTU: 1500, Flags: Is-Primary

3. Egress features

There is another flavor of this Hub & Spoke VPN with one interface. A flavor that will allow us to make an IP forwarding lookup on the hub PE and this way have egress features. This is particularly important for firewall filters, CoS, accounting, sampling, service features, etc. that need the hub PE to actually process the packet.

In order to have egress features on the hub PE, we will configure a 2nd VRF on the HUB PE that will make the IP forwarding lookup:

To conclude, by having a more complex solution, two HUB VRFs instead of one, we get the IP lookup we want.


External Resources: