Almost 3 years ago I have published an article how to set up layer 2 VPN between on-prem vSphere environment and vCloud Director Org VDC.
As both vCloud Director and NSX evolved quite a bit since to simplify the whole set up, here comes the part II.
Let me first summarize the use case:
The tenant has an application that resides on 3 different VLAN based networks running in its own (vSphere) datacenter. The networks are routed with existing physical router. The tenant wants to extend 2 of these networks to cloud for cloud bursting or DR purposes, but not the 3rd one (for example because there runs a physical database server).
The following diagram shows the setup.
The main advancements are:
- vCloud Director natively supports NSX L2 VPN (VCD 8.20 or newer needed).
- NSX now (since 6.2) supports configuration of unstretched networks directly (no static routes are necessary anymore)
- This means the full setup can be done by the tenant in self-service fashion
Here are the steps:
- The tenant will deploy freely available NSX Standalone Edge in its datacenter connected to trunk port with 2 VLANs mapped (10 and 11). Additional network configuration is necessary (forged transmits and promiscuous mode or sink port creation – see the link)
- In the cloud Org VDC tenant deploys two routed Org VDC networks with identical subnets and gateways as networks A and B. These networks must be connected to the Org VDC Edge GW via subinterface (there can be up to 200 such networks on single Edge). The Org VDC Edge must have advanced networking enabled.
- Tenant enables and configures L2VPN server on its Org VDC Edge GW. Note that this is a premium feature that the service provider must enable in Organization first (see this blog post).
- Before the L2VPN tunnel is established the following must be taken into account:
- The Org VDC Edge GW IP addresses are identical with the on-prem existing physical router. Therefore Egress Optimization Gateway addresses must be entered in the Peer Site configuration. That will prevent the Org VDC Edge GW from sending ARP replies over the tunnel.
- The same must be performed on the Standalone NSX Edge via CLI (see egress-optimize command here).
- The non-stretched network (subnet C) must be configured on the Org VDC Edge GW so it knows that the subnet is reachable through the tunnel and not via its upstream interface(s). This option however is not in vCloud UI, instead vCloud networking API must be used.
Edit 3/26/2018: This does not works for standalone NSX Edges. See the end of the article for more details.
Alternatively the provider could configure non-stretched network directly in the NSX UI:
- Finally, the tunnel can be established by configuring L2VPN server details on the on-prem Standalone NSX Edge L2VPN client (endpoint IP, port, credentials, encryption) and providing VLAN to tunnel mappings.
- Note to find the Org VDC network subinterface tunnel mapping vCloud API must be used again:
- The Org VDC Edge GW IP addresses are identical with the on-prem existing physical router. Therefore Egress Optimization Gateway addresses must be entered in the Peer Site configuration. That will prevent the Org VDC Edge GW from sending ARP replies over the tunnel.
Edit 3/26/2018:
After multiple questions regarding unstretched networks and some testing I need to make some clarifications.
The routing of unstretched networks through the tunnel is achieved via static routes configured on the Edge GW. So in principle it still works the same way as described in the original article, the difference doing it via UI/API is that the setting of the IPs and routes is automatic.
The server Edge routing table looks like this:
show ip route S 0.0.0.0/0 [1/0] via 10.0.2.254 C 10.0.2.0/24 [0/0] via 10.0.2.121 C 169.254.64.192/26 [0/0] via 169.254.64.193 C 169.254.255.248/30 [0/0] via 169.254.255.249 C 192.168.100.0/24 [0/0] via 192.168.100.1 C 192.168.101.0/24 [0/0] via 192.168.101.1 S 192.168.102.0/24 [1/0] via 169.254.64.194 show ip address ... 17: vNic_4094@br-sub: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 00:50:56:88:31:21 brd ff:ff:ff:ff:ff:ff inet 169.254.64.193/26 brd 169.254.64.255 scope global vNic_4094 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:fe88:3121/64 scope link valid_lft forever preferred_lft forever
You can see that the 169.254.64.193 IP address was autoassigned to the 4096 tunnel interface and static route was set to route the unstretched network to the other side via IP 169.254.64.194. The assignment of the .194 address on the other Edge will happen only if that Edge is managed by NSX and is actually performing routing! This is in fact not true for the use case above (with standalone Edge and existing physical router). Therefore the following manual approach must be taken:
- Create Org VDC transit network with arbitrary small subnet (e.g. 169.254.200.0/29) in the cloud. Assign IP .1 as the gateway on the Org VDC Edge. This network will not be used for workloads, it is used just for routing to unstretched network.
- Create corresponding VLAN transit network on-prem. Assign IP .2 as its gateway interface on the existing router (note the IP addresses of the routing intefaces in #1 and #2 are different).
- Create L2 VPN tunnel as before, however also stretch the transit network but do not optimize its GW (no need as on-prem and cloud are using different IPs).
- Create static routes on the Org VDC Edge GW to route to on-prem unstretched networks via the 169.254.200.2 transit network router IP.
Note that this is approach very similar to the original blog post. The only difference is that we must create separate transit network as vCloud Director does not support multiple subnets on the same Edge GW interface.