Show / Hide Table of Contents

Class Subnet

A logical subdivision of a VCN. Each subnet consists of a contiguous range of IP addresses that do not overlap with other subnets in the VCN. Example: 172.16.1.0/24. For more information, seeOverview of the Networking Service andVCNs and Subnets.To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized,talk to an administrator. If you're an administrator who needs to write policies to give users access, seeGetting Started with Policies.

Inheritance
object
Subnet
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Oci.CoreService.Models
Assembly: OCI.DotNetSDK.Core.dll
Syntax
public class Subnet

Properties

AvailabilityDomain

Declaration
[JsonProperty(PropertyName = "availabilityDomain")]
public string AvailabilityDomain { get; set; }
Property Value
Type Description
string

The subnet's availability domain. This attribute will be null if this is a regional subnet instead of an AD-specific subnet. Oracle recommends creating regional subnets.
Example: Uocm:PHX-AD-1

CidrBlock

Declaration
[Required(ErrorMessage = "CidrBlock is required.")]
[JsonProperty(PropertyName = "cidrBlock")]
public string CidrBlock { get; set; }
Property Value
Type Description
string

The subnet's CIDR block.
Example: 10.0.1.0/24

Remarks

Required

CompartmentId

Declaration
[Required(ErrorMessage = "CompartmentId is required.")]
[JsonProperty(PropertyName = "compartmentId")]
public string CompartmentId { get; set; }
Property Value
Type Description
string

The OCID of the compartment containing the subnet.

Remarks

Required

DefinedTags

Declaration
[JsonProperty(PropertyName = "definedTags")]
public Dictionary<string, Dictionary<string, object>> DefinedTags { get; set; }
Property Value
Type Description
Dictionary<string, Dictionary<string, object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
Example: {"Operations": {"CostCenter": "42"}}

DhcpOptionsId

Declaration
[JsonProperty(PropertyName = "dhcpOptionsId")]
public string DhcpOptionsId { get; set; }
Property Value
Type Description
string

The OCID of the set of DHCP options that the subnet uses.

DisplayName

Declaration
[JsonProperty(PropertyName = "displayName")]
public string DisplayName { get; set; }
Property Value
Type Description
string

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

DnsLabel

Declaration
[JsonProperty(PropertyName = "dnsLabel")]
public string DnsLabel { get; set; }
Property Value
Type Description
string

A DNS label for the subnet, used in conjunction with the VNIC's hostname and VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet (for example, bminstance1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter and is unique within the VCN. The value cannot be changed.
The absence of this parameter means the Internet and VCN Resolver will not resolve hostnames of instances in this subnet.
For more information, see DNS in Your Virtual Cloud Network.
Example: subnet123

FreeformTags

Declaration
[JsonProperty(PropertyName = "freeformTags")]
public Dictionary<string, string> FreeformTags { get; set; }
Property Value
Type Description
Dictionary<string, string>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.
Example: {"Department": "Finance"}

Id

Declaration
[Required(ErrorMessage = "Id is required.")]
[JsonProperty(PropertyName = "id")]
public string Id { get; set; }
Property Value
Type Description
string

The subnet's Oracle ID (OCID).

Remarks

Required

Ipv6CidrBlock

Declaration
[JsonProperty(PropertyName = "ipv6CidrBlock")]
public string Ipv6CidrBlock { get; set; }
Property Value
Type Description
string

For an IPv6-enabled subnet, this is the IPv6 prefix for the subnet's IP address space. The subnet size is always /64. See IPv6 Addresses.
Example: 2001:0db8:0123:1111::/64

Ipv6CidrBlocks

Declaration
[JsonProperty(PropertyName = "ipv6CidrBlocks")]
public List<string> Ipv6CidrBlocks { get; set; }
Property Value
Type Description
List<string>

The list of all IPv6 prefixes (Oracle allocated IPv6 GUA, ULA or private IPv6 prefixes, BYOIPv6 prefixes) for the subnet.

Ipv6VirtualRouterIp

Declaration
[JsonProperty(PropertyName = "ipv6VirtualRouterIp")]
public string Ipv6VirtualRouterIp { get; set; }
Property Value
Type Description
string

For an IPv6-enabled subnet, this is the IPv6 address of the virtual router.
Example: 2001:0db8:0123:1111:89ab:cdef:1234:5678

LifecycleState

Declaration
[Required(ErrorMessage = "LifecycleState is required.")]
[JsonProperty(PropertyName = "lifecycleState")]
[JsonConverter(typeof(ResponseEnumConverter))]
public Subnet.LifecycleStateEnum? LifecycleState { get; set; }
Property Value
Type Description
Subnet.LifecycleStateEnum?

The subnet's current state.

Remarks

Required

ProhibitInternetIngress

Declaration
[JsonProperty(PropertyName = "prohibitInternetIngress")]
public bool? ProhibitInternetIngress { get; set; }
Property Value
Type Description
bool?

Whether to disallow ingress internet traffic to VNICs within this subnet. Defaults to false.
For IPV4, prohibitInternetIngress behaves similarly to prohibitPublicIpOnVnic. If it is set to false, VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in {@link CreateVnicDetails}). If prohibitInternetIngress is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a privatesubnet).
For IPv6, if prohibitInternetIngress is set to true, internet access is not allowed for any IPv6s assigned to VNICs in the subnet. Otherwise, ingress internet traffic is allowed by default.
Example: true

ProhibitPublicIpOnVnic

Declaration
[JsonProperty(PropertyName = "prohibitPublicIpOnVnic")]
public bool? ProhibitPublicIpOnVnic { get; set; }
Property Value
Type Description
bool?

Whether VNICs within this subnet can have public IP addresses. Defaults to false, which means VNICs created in this subnet will automatically be assigned public IP addresses unless specified otherwise during instance launch or VNIC creation (with the assignPublicIp flag in {@link CreateVnicDetails}). If prohibitPublicIpOnVnic is set to true, VNICs created in this subnet cannot have public IP addresses (that is, it's a private subnet).
Example: true

RouteTableId

Declaration
[Required(ErrorMessage = "RouteTableId is required.")]
[JsonProperty(PropertyName = "routeTableId")]
public string RouteTableId { get; set; }
Property Value
Type Description
string

The OCID of the route table that the subnet uses.

Remarks

Required

SecurityListIds

Declaration
[JsonProperty(PropertyName = "securityListIds")]
public List<string> SecurityListIds { get; set; }
Property Value
Type Description
List<string>

The OCIDs of the security list or lists that the subnet uses. Remember that security lists are associated with the subnet, but the rules are applied to the individual VNICs in the subnet.

SubnetDomainName

Declaration
[JsonProperty(PropertyName = "subnetDomainName")]
public string SubnetDomainName { get; set; }
Property Value
Type Description
string

The subnet's domain name, which consists of the subnet's DNS label, the VCN's DNS label, and the oraclevcn.com domain.
For more information, see DNS in Your Virtual Cloud Network.
Example: subnet123.vcn1.oraclevcn.com

TimeCreated

Declaration
[JsonProperty(PropertyName = "timeCreated")]
public DateTime? TimeCreated { get; set; }
Property Value
Type Description
DateTime?

The date and time the subnet was created, in the format defined by RFC3339.
Example: 2016-08-25T21:10:29.600Z

VcnId

Declaration
[Required(ErrorMessage = "VcnId is required.")]
[JsonProperty(PropertyName = "vcnId")]
public string VcnId { get; set; }
Property Value
Type Description
string

The OCID of the VCN the subnet is in.

Remarks

Required

VirtualRouterIp

Declaration
[Required(ErrorMessage = "VirtualRouterIp is required.")]
[JsonProperty(PropertyName = "virtualRouterIp")]
public string VirtualRouterIp { get; set; }
Property Value
Type Description
string

The IP address of the virtual router.
Example: 10.0.14.1

Remarks

Required

VirtualRouterMac

Declaration
[Required(ErrorMessage = "VirtualRouterMac is required.")]
[JsonProperty(PropertyName = "virtualRouterMac")]
public string VirtualRouterMac { get; set; }
Property Value
Type Description
string

The MAC address of the virtual router.
Example: 00:00:00:00:00:01

Remarks

Required

In this article
Back to top