Tutorial: Setting Up a Direct Connection Between VMs in a Net and the Internet

The goal of this tutorial is to enable virtual machines (VMs) in a Subnet to directly connect to the Internet using an Internet gateway and public IPs.

In this tutorial, you learn how to:

  • Set up an Internet gateway for your Net

  • Configure your route tables and security groups for a direct connection to the Internet

Before you begin:

  1. Set up a Net architecture. For more information, see Creating a Net.

  2. Allocate to your account as many public IPs as you need for your VMs. For more information, see Allocating a Public IP to Your Account.

  1. Create an Internet gateway. For more information, see Creating an Internet Service.

  2. Attach the Internet gateway to the Net. For more information, see Attaching an Internet Service to a Net.

  3. In the route table associated with the Subnet in which your VMs are, create a route with 0.0.0.0/0 as destination and the ID of the Internet gateway as target. For more information, see Creating a Route.

    You can use the 0.0.0.0/0 CIDR block as destination to scope all the destinations that are not explicitly routed in the route table, or you can use a smaller range of IPs corresponding, for example, to the public IPs of your internal network.

  4. To allow flows from your VMs to the Internet, add a rule allowing outbound flows to the Internet (0.0.0.0/0 CIDR block, or a smaller range of public IPs) to the security group used for VMs in your Subnet. For more information, see Adding Rules to a Security Group.

    To allow the Internet to initiate connections to your VMs, add another rule allowing inbound flows from the Internet.

  5. Associate a public IP with each VM created in your Subnet that you want to directly connect to the Internet. For more information, see Linking a Public IP with a VM or a Network Interface.

    This public IP is the public IP used by the VM to be accessed from and to access to the Internet through the Internet gateway. For more information, see About Internet Services.

    Instances in your Subnet that are associated with a public IP are directly connected to the Internet using the Internet gateway.

Related Pages