- VMware vCloud Director Cookbook
- Daniel Langenhan
- 614字
- 2021-07-23 15:45:11
Using vApp Network fencing
In this recipe, we will explore vApp Network fencing. We will see how we can use this feature.
Getting ready
To play with fencing, we need to have a Direct Organization Network (or isolated, but that's not as much fun) and some VM templates.
How to do it...
- Create a new vApp using the
button.
- Add two VMs to the vApp and name them.
- Connect the VMs to the Direct Organization Network using the Static - IP manual option.
- Set the manual IPs outside the range of the Static IP Pool for each VM.
- In the Configure Networking section, click on Fence vApp, as shown in the following screenshot:
- Finish the vApp creation.
- Deploy the vApp.
- After the vApp is deployed, double-click back into it and go to Virtual Machines:
- See that the VMs now have an internal and external IP. To communicate with the VMs, use the external IP.
- Now stop the vApp.
- Right-click on the vApp and choose Copy to....
- Name the vApp and click on OK.
- After the vApp has been copied, start both vApps (the original and the copy).
- Check the IPs of all VMs in all vApps.
How it works...
You may know vApp Network fencing from VMware Lab Manager, but the vCloud implementation is different.
Fencing allows you to re-use the same IPs and MAC addresses in multiple vApps. This is rather different from using an isolated network, as fencing allows full connection to the fenced VMs just with different IPs, as you can see in the following diagram:

The VMs inside the fence communicate using the internal IPs (.20 and .21), but appear to be using the external IPs (.100 and .101) for any communication to the outside. Communication is allowed out, but not in.
Fencing allows one to deploy a vApp with the same content multiple times and still use them without changing their IP or MAC addresses. However, you need to understand that the VMs inside are the same, meaning that if you have an Active Directory inside the vApp, things will go wrong. The AD will advertise itself with its internal IP that is not accessible via the outside; also, it will receive AD advertising from the original AD outside the vApp (the AD you copied it from) with the same IP.
What happens in the background is that for each fenced vApp, a new Edge device is deployed and configured. The Edge has the same name as the network; however, the HREF (the number behind the name) is different; refer to the following screenshot (compare the Names):

There's more...
Because we are again using a vApp router (Edge), we can have a look at the settings by performing the following steps:
- Right-click on the Organization Network in the vApp.
- Choose Configure Services.
- Click on Firewall and then on NAT.
Have a look at the Firewall and NAT values, as shown in the following table:

This setting allows the VMs in the fence (.20 and .21) to be reached from the VMs on the outside using the public IPs (.100 and .101). However, you should be rather careful with a configuration like that. Maybe opening up only certain ports for the inbound connection is a better idea.
In addition to all this, you can configure the external IP (DNAT) of each VM by performing the following steps:
- Right-click on the Organization Network in the vApp.
- Choose Configure Services.
- Click on NAT.
- Click on the DNAT rule and click on Edit. You should see the following screen:
- Change the Mapping Mode value to Manual and enter the IP under External IP.
- Click on OK and again on OK to activate these settings.
- Mastering Microsoft Forefront UAG 2010 Customization
- 審計全流程技術操作實務指南
- 一本書學內部審計:新手內部審計從入門到精通
- Pentaho Business Analytics Cookbook
- 會計信息化基礎(金蝶版)
- 審計綜合模擬實訓
- 大數據搜索與挖掘及可視化管理方案 :Elastic Stack 5:Elasticsearch、Logstash、Kibana、X-Pack、Beats (第3版)
- Microsoft System Center Data Protection Manager 2012 SP1
- 陜西國家統計調查專題研究集萃(2006—2015)
- 中國政府統計問題研究
- Salesforce Essentials for Administrators
- 《企業內部控制基本規范》合規實務指南
- Stata統計分析與行業應用案例詳解(第2版)
- 中國國內生產總值核算問題研究
- Managing Virtual Infrastructure with Veeam? ONE?