In CloudStack, it is possible to create a “shared network” with public subnet. VM instance created inside this “shared network” will have a public IP assigned directly to its network interface. Why would you need a “shared network” with public subnet? Many hosting providers prefer to create VPS instances where a public IP address is directly allocated to the customer’s VM.
A CloudStack shared network solves many requirements of hosting providers like:
- To avoid any network translation (NAT)
- To remove dependency on a virtual firewall for routing traffic
- To use a physical router/firewall for performance and security reasons
- Allow sharing of the same subnet among multiple customers who require VPS hosting
In CloudStack 4.1.1, due to a bug (CLOUDSTACK-4323), its not possible to create a shared network using the management UI. It can however easily be created using the CloudMonkey tool and the createNetwork API
cloudmonkey> create network displaytext=ExternalNetwork name=ExternalNetwork networkofferingid=DefaultSharedNetworkOfferingId zoneid=ZoneId startip=x.x.x.x endid=x.x.x.y netmask=255.255.255.0 vlan=vlanid
Remember to use real Public IPs for startip and endip
It is also possible to have a public subnet dedicated to a customer’s domain (and his subdomains) by using the domainid option. Only accounts belonging to a specific customer domain will be able to see and create VM instances on this shared network.
cloudmonkey> create network displaytext=ExternalNetwork name=ExternalNetwork networkofferingid=DefaultSharedNetworkOfferingId zoneid=ZoneId startip=x.x.x.x endid=x.x.x.y netmask=255.255.255.0 vlan=vlanid domainid=domainid aclType=Domain subdomainaccess=True
In CloudStack 4.2.0, the UI bug has been fixed. The shared network can be created using the UI.
The VM that you create would have an IP in the 100.100.100.0 range instead of the usual 10.0.0.0/8, 172.16.0.0/16 or 192.168.0.0/24 RFC1918 private segment.
Please substitute 100.100.100.x with a real valid IP range for your network. This would be a routable subnet assigned by your Internet Service Provider.