Skip to main content

Subnet

A subnet is a part of your VPC's CIDR that is located in one AZ. Servers and other resources are created inside a subnet, not directly inside the VPC. You need at least one subnet for each AZ you want to create resources in; for example, for servers you create in the Forough AZ, you need a subnet in that AZ.

How Subnets Work​

Each subnet belongs to one AZ and one VPC. The subnet's CIDR must be within the VPC network's CIDR and must not overlap with another subnet in the same VPC. A subnet is private from the start, and its resources can access the internet only through an Elastic IP attached to the resource itself or through the subnet's NAT Gateway. Traffic between resources inside a VPC is free.

A subnet's AZ, VPC, and CIDR can't be changed after creation, but you can change its name and network settings (such as DNS) at any time.

Creating a Subnet​

  1. In the Arvancloud panel, go to the VPC section and select Subnet from the menu.
  2. Click the New Subnet button.
  3. Region: select the region your VPC is in. For example, if your VPC is in Iran Central 1, select this region.
  4. VPC: select the VPC you want to create the subnet in.

Note that a subnet can't be moved to another VPC.

  1. Name: choose an English name for the subnet.
  2. AZ: then select the AZ the subnet should be created in. The available AZs are:
  • Bamdad, Forough, and Simin (for the Iran Central 1 region)
  • Shahriar (for the Iran Northwest region)

Note that each subnet is located in only one AZ and can't be moved to another AZ.

  1. IPv4 CIDR: enter a range within the VPC network's CIDR. For example, if your VPC network's CIDR is 10.0.0.0/24, the ranges 10.0.0.0/26 and 10.0.0.64/26 are valid.

Note that the subnet's CIDR can't be changed after creation.

  1. (Optional) Open the network settings section and set the DNS, NTP, MTU, IPv4 lease time, and IP allocation range values. These settings are explained in the Advanced Settings section.
  2. Click the Create Subnet button.

After the subnet's status changes to Available, you can create servers and other resources in it.

Advanced Settings​

These values are optional and are applied to the resources inside the subnet. If you leave this section empty, Arvancloud's default values are used.

  • DNS Server Address The address of the servers' DNS servers. If you have an internal DNS, you can enter its address so servers use it instead of Arvancloud's default DNS. You can enter up to 4 IPv4 addresses and 4 IPv6 addresses.
  • NTP Server Address The address of the time servers used to synchronize the servers' clocks. You can enter up to 4 IPv4 addresses and 4 IPv6 addresses.
  • MTU The maximum size of network packets, in bytes. If you have no specific need, leave this field empty.
  • Static route A static route for sending the traffic of specific ranges through a custom next hop.

Note that changing DNS or NTP affects all resources in the subnet, and servers get the new value after a network restart.

Subnet Internet Access​

In general, you can implement the following scenarios with subnets:

ScenarioDescription
The server should be reachable from the internetEnable internet access (Network Gateway) on the VPC, and then attach an Elastic IP to the server.
Resources should access the internet (egress) but not be reachable from outsideAttach a NAT Gateway to the subnet.
You don't need internet accessNothing needs to be done; the subnet is private and isolated from the start.

Viewing and Managing Subnets​

Click Subnet in the menu to see the list of the region's subnets, with the VPC, AZ, CIDR, and status of each one. From each subnet's actions menu, you can edit its name and network settings or delete the subnet.

Note that a subnet can't be deleted while it has a NAT Gateway.

Limits​

LimitValue
Number of subnets per VPC30
Number of subnets per AZ100
Smallest allowed prefix for a subnet/28
Number of NAT Gateways per subnet1 (up to 4 on request)
Number of DNS and NTP servers per subnet4 IPv4 addresses and 4 IPv6 addresses

Pricing​

Creating subnets and traffic inside the VPC are free. Inbound traffic from the internet is charged per GB, and each Elastic IP attached to a resource is charged monthly. Read more details on the Virtual Private Cloud page.