What is Virtual Networks?

Learn what Virtual Networks offers, how networks, subnets, routers, and ports fit together, and which dimensions you are billed for.

Virtual Networks lets you build private networks for the resources in your project. You create a network, divide it into subnets with private IPv4 address blocks, and connect subnets to each other and to the internet with routers. Instances connect to subnets through ports. The console also checks why an instance can or can't reach the internet, and draws a live topology of your networks.

Key features

How it works

A network is an isolated layer-2 network in a project. Subnets give it address ranges, and their DHCP service hands out the addresses. In the console and the REST API, a subnet's block must be a private IPv4 block inside 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16. An instance connects to the network through a port, which takes its fixed IP address from one of the network's subnets. The port also holds the security groups that filter the instance's traffic.

A router connects subnets. Each subnet that you attach becomes an interface of the router. A router with an external gateway also connects these subnets to an external network, the way to the internet. An instance without a Floating IP reaches the internet through the router's SNAT address. A Floating IP makes an instance reachable from the internet.

Creating and deleting networks, routers, and ports run as asynchronous operations. A new network or router is Building until the platform finishes it, and then Active, or Error with the reason on its page. Changes to subnets take effect when you save them.

Virtual Networks is available where the project's region offers it. In a region that doesn't, the console leaves Networks and Routers out of the menu, a link to one of their pages shows a notice instead of the page, and new networks and routers are refused.

The Network topology page: the internet node at the top, a router and Floating IPs below it, and a network drawn as a container that holds its subnets and instances, with filters for type and network and a details panel for the selected instance.
Console screenshot · illustrative data

Use cases

  • Multi-tier applications. Put web, application, and database servers in separate subnets of one network, connect the subnets with a router, and control which tier reaches which with security groups.
  • Private back ends. Run servers without public addresses that still reach the internet for updates through the router's SNAT address.
  • Hybrid connectivity. Connect your subnets to an on-premises network over an IPsec tunnel with Site-to-Site VPN.

Billing

Virtual Networks bills these dimensions:

DimensionHow it's billed
RouterPer hour from creation until deletion, when routers have a price in your region. A router that never becomes Active isn't billed.
Internet egressPer GB that leaves the cloud through a router's external gateway, when egress has a price in your region. Inbound traffic isn't counted. Traffic that a load balancer sends is billed as load balancer egress instead.
Floating IPPer hour while the address is allocated, whether or not it's associated. See Floating IPs.

Networks, subnets, and ports aren't billed. Every time-based charge is billed for at least 60 seconds over the resource's lifetime. For how usage becomes charges on your invoice, see How billing works. For prices, see Pricing.

Limits

  • In the console and the REST API, a subnet's block must be a private IPv4 block inside 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16.
  • Network and router names use 1–63 lowercase letters, numbers, and hyphens, and must be unique within the project.
  • A port that you create in the console holds one fixed IP address.
  • Networks, subnets, ports, routers, and Floating IPs count against the subscription's quota and the project's allocation. See Quotas.

For all limits, see Virtual Networks limits.

Next steps

On this page