VMware VSHIELD APP 1.0 - API Manual de usuario Pagina 44

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 104
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 43
vShield API Programming Guide
44 VMware, Inc.
Example 5-18. Configure NAT service
POST https://<vsm-ip>/api/2.0/networks/<internal-portgroup-vc-moref-id>/edge
<vshieldEdgeConfig xmlns="vmware.vshield.edge.2.0">
<natConfig>
<rule>
<type>snat</type>
<internalIpAddress>192.168.10.11</internalIpAddress>
<externalIpAddress>10.112.2.146</externalIpAddress>
<enableLog>false</enableLog>
</rule>
<rule>
<type>dnat</type>
<protocol>tcp</protocol>
<internalIpAddress>192.168.10.2-192.168.10.12</internalIpAddress>
<internalPort>any</internalPort>
<externalIpAddress>10.112.2.146</externalIpAddress>
<externalPort>any</externalPort>
<enableLog>true</enableLog>
</rule>
</natConfig>
</vshieldEdgeConfig>
Forthedatapathtowork,youneedtochangethedefaultfirewallpolicytoALLOW,orpunchFirewallrules
toallowdatatrafficonexternalandinternalinterfaces.
Rules:
For<protocol>optionstcpandudp,youmustspecifysourcePortanddestinationPortelements.
Foroptionsicmpandany,thesourcePortanddestinationPortelementsarenotexpected
Youmustadd<icmpType>ifyouconfigureicmpastheprotocol.
TheexternalIpAddressandinternalIpAddresselementscanbeenteredineitherofthesemethods:
<ipAddress>specifiedasasingleIPaddress,ahyphenseparatedIPaddressrange(forexample,
192.168.10.1-192.168.10.2555) orasubnetinCIDRnotation(198.168.10.1/24).
thekeywordany
TheexternalPortandinternalPortparameterscanbeenteredinoneofthefollowingformats:the
keywordany,theportnumberasaninteger,orarangeofportnumber,forexampleportX-portY.
YoucanaddmultipleSNATrulesbyenteringmultiple<type>snat</type>sectionsinthebody.
SNATdoesnotsupportportorprotocolparameters.
Loggingisdisabledbydefault.Toenablelogging,addan<enableLog>elementsettotrue.
Delete NAT Configuration
TodeleteNATconfiguration,postanemptyruleset.
Example 5-19. Delete NAT rules
POST https://<vsm-ip>/api/2.0/networks/<internal-portgroup-vc-moref-id>/edge
<vshieldEdgeConfig xmlns="vmware.vshield.edge.2.0">
<natConfig/>
</vshieldEdgeConfig>
Vista de pagina 43
1 2 ... 39 40 41 42 43 44 45 46 47 48 49 ... 103 104

Comentarios a estos manuales

Sin comentarios