Steps to connect a VM to a public IP address and add NAT and firewall rules for the VM:
Request a Public IP Address
Add a NAT Rule for the Virtual Machine
Create a Firewall Rule
Verify Your New Public-Facing Virtual Machine
Request a Public IP Address:
You assign a public IP address to the VM to make it accessible from the Internet.
In the VMware Cloud console browser tab, navigate to the SDDC summary page
Click the Networking & Security tab
Under System, click Public IPs
Click REQUEST NEW IP
Enter Photo-App-01 in the Notes text box
Click SAVE
Record the public IP address that is generated in a Notepad
Add a NAT Rule for the Virtual Machine:
You add a NAT rule to map the public IP address to the VM.
In the VMware Cloud console browser tab, click NAT under Network
Create a NAT rule to direct traffic from the public IP address to the application IP address
Click ADD NAT RULE
Enter Photo-App-Rule-1 in the Rule Name text box
The Public IP value is pre-selected with the public IP address that was created in the previous task.
For multiple public IPs, you select the appropriate public IP from the drop-down menu.
In the All Traffic drop-down menu, select HTTP.
The Public Port is automatically populated with port 80
In the Internal IP text box, enter the local IP address for the Photo-App-01 virtual machine
192.168.xxx.x
You can find the Photo-App-01 VM IP address recorded previously
In the Firewall drop-down menu, select Match Internal Address
Click SAVE
Open a browser to the Photo-App-01 public IP address that was generated previously
http://XX.XX.XX.XX
The application is not accessible because the firewall does not allow inbound traffic to the virtual machine
Create a Firewall Rule:
You enable access to a web application through the VMware Cloud on the AWS gateway firewall.
In the VMware Cloud console browser tab, click Gateway Firewall under Security
Select the Compute Gateway tab, if not already selected
Create a firewall rule to allow HTTP traffic from any source to the public IP address of the Photo-App-01 application
Click ADD RULE
Enter Photo-App-Public as the Name
Leave Any as the value for Sources
In the Destinations text box, click the edit icon
The Set Destination window appears
Select the Photo-App check box and click APPLY
In the Services text box, click the edit icon
The Set Services window appears
Select the HTTP check box
You can use the Apply Filter text field to search for the service
Click APPLY
Click PUBLISH to save the modifications to the firewall rule
Verify Your New Public-Facing Virtual Machine:
Open a browser to the Photo-App-01 public IP address that was generated in a previous task
http://XX.XX.XX.XX
Click the login icon in the top-left corner
Enter your username in the user name field
Enter your password in the password field
Observe that the uploaded photos appear
Comments