5.1

Table Of Contents
<VAppScopedVmId>3963994b-5a0a-48fe-b9ae-7f9a2d8e8e5b</VAppScopedVmId>
<VmNicId>0</VmNicId>
<IpType>assigned</IpType>
</DestinationVm>
<SourcePortRange>Any</SourcePortRange>
<SourceIp>Any</SourceIp>
<EnableLogging>false</EnableLogging>
</FirewallRule>
NAT Service
A NatService element defines network address translation services to virtual machines on the network. This
simple NatService defines a single rule that implements an IP translation stratagy for a single Vm.
<NatService>
<IsEnabled>true</IsEnabled>
<NatType>ipTranslation</NatType>
<Policy>allowTraffic</Policy>
<NatRule>
<OneToOneVmRule>
<MappingMode>automatic</MappingMode>
<VAppScopedVmId>3963994b-5a0a-48fe-b9ae-7f9a2d8e8e5b</VAppScopedVmId>
<VmNicId>0</VmNicId>
</OneToOneVmRule>
</NatRule>
</NatService>
You can see this example in the context of a vApp NetworkConfigSection in “Example: Update a
NetworkConfigSection,” on page 110
A NatService element like this one configures the service to use port forwarding instead of IP translation.
Instead of using a OneToOneVmRule, which specifies one external IP address to one NIC, it uses a VmRule element,
which enables port forwarding by allowing one external IP address to be forward to different ports on different
virtual machines.
<NatService>
<IsEnabled>true</IsEnabled>
<NatType>portForwarding</NatType>
<Policy>allowTraffic</Policy>
<NatRule>
<VmRule>
<ExternalPort>22</ExternalPort>
<VAppScopedVmId>3963994b-5a0a-48fe-b9ae-7f9a2d8e8e5b</VAppScopedVmId>
<VmNicId>0</VmNicId>
<InternalPort>22</InternalPort>
<Protocol>TCP</Protocol>
</VmRule>
</NatRule>
</NatService>
Static Routing Service
A StaticRoutingService specifies static routes to other networks. In addition to creating static routes from
organization vDC networks on an EdgeGateway (see “Example: Static Routes Between Organization vDC
Networks,” on page 161, you can create static routes between vApp networks if they both define the same
ParentNetwork. Assume two vApp networks that have the following properties:
n
The Configuration of the vApp network in vApp1 has a RouterInfo element whose ExternalIp value is
192.168.0.100.
vCloud API Programming Guide
114 VMware, Inc.