# Compute Engine v1 API - Class NetworkInterface (3.28.0)

3.28.0 (latest) 3.27.0 3.26.0 3.25.0 3.24.0 3.23.0 3.22.0 3.21.0 3.20.0 3.19.0 3.18.0 3.17.0 3.16.0 3.15.0 3.14.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0

    public sealed class NetworkInterface : IMessage<NetworkInterface>, IEquatable<NetworkInterface>, IDeepCloneable<NetworkInterface>, IBufferMessage, IMessage

Reference documentation and code samples for the Compute Engine v1 API class NetworkInterface.

A network interface resource attached to an instance.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> NetworkInterface

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[NetworkInterface](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.NetworkInterface), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[NetworkInterface](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.NetworkInterface), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[NetworkInterface](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.NetworkInterface), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Compute.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1)

## Assembly

Google.Cloud.Compute.V1.dll

## Constructors

### NetworkInterface()

    public NetworkInterface()

### NetworkInterface(NetworkInterface)

    public NetworkInterface(NetworkInterface other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.NetworkInterface` |

## Properties

### AccessConfigs

    public RepeatedField<AccessConfig> AccessConfigs { get; }

An array of configurations for this interface. Currently, only one access
config, ONE_TO_ONE_NAT, is supported. If there are noaccessConfigs specified, then this instance will have
no external internet access.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.AccessConfig` |   |

### AliasIpRanges

    public RepeatedField<AliasIpRange> AliasIpRanges { get; }

An array of alias IP ranges for this network interface.
You can only specify this field for network interfaces in VPC networks.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.AliasIpRange` |   |

### EnableVpcScopedDns

    public bool EnableVpcScopedDns { get; set; }

Optional. If true, DNS resolution will be enabled over this interface. Only valid
with network_attachment.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### Fingerprint

    public string Fingerprint { get; set; }

Fingerprint hash of contents stored in this network interface.
This field will be ignored when inserting an Instance or
adding a NetworkInterface. An up-to-date
fingerprint must be provided in order to update theNetworkInterface. The request will fail with error400 Bad Request if the fingerprint is not provided, or412 Precondition Failed if the fingerprint is out of date.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### HasEnableVpcScopedDns

    public bool HasEnableVpcScopedDns { get; }

Gets whether the "enable_vpc_scoped_dns" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasFingerprint

    public bool HasFingerprint { get; }

Gets whether the "fingerprint" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasIgmpQuery

    public bool HasIgmpQuery { get; }

Gets whether the "igmp_query" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasInternalIpv6PrefixLength

    public bool HasInternalIpv6PrefixLength { get; }

Gets whether the "internal_ipv6_prefix_length" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasIpv6AccessType

    public bool HasIpv6AccessType { get; }

Gets whether the "ipv6_access_type" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasIpv6Address

    public bool HasIpv6Address { get; }

Gets whether the "ipv6_address" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasKind

    public bool HasKind { get; }

Gets whether the "kind" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasName

    public bool HasName { get; }

Gets whether the "name" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasNetwork

    public bool HasNetwork { get; }

Gets whether the "network" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasNetworkAttachment

    public bool HasNetworkAttachment { get; }

Gets whether the "network_attachment" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasNetworkIP

    public bool HasNetworkIP { get; }

Gets whether the "network_i_p" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasNicType

    public bool HasNicType { get; }

Gets whether the "nic_type" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasParentNicName

    public bool HasParentNicName { get; }

Gets whether the "parent_nic_name" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasQueueCount

    public bool HasQueueCount { get; }

Gets whether the "queue_count" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasServiceClassId

    public bool HasServiceClassId { get; }

Gets whether the "service_class_id" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasStackType

    public bool HasStackType { get; }

Gets whether the "stack_type" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasSubnetwork

    public bool HasSubnetwork { get; }

Gets whether the "subnetwork" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasVlan

    public bool HasVlan { get; }

Gets whether the "vlan" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### IgmpQuery

    public string IgmpQuery { get; set; }

Indicate whether igmp query is enabled on the network interface
or not. If enabled, also indicates the version of IGMP supported.
Check the IgmpQuery enum for the list of possible values.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### InternalIpv6PrefixLength

    public int InternalIpv6PrefixLength { get; set; }

The prefix length of the primary internal IPv6 range.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### Ipv6AccessConfigs

    public RepeatedField<AccessConfig> Ipv6AccessConfigs { get; }

An array of IPv6 access configurations for this interface. Currently, only
one IPv6 access config, DIRECT_IPV6, is supported. If there
is no ipv6AccessConfig specified, then this instance will
have no external IPv6 Internet access.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Compute.V1/latest/Google.Cloud.Compute.V1.AccessConfig` |   |

### Ipv6AccessType

    public string Ipv6AccessType { get; set; }

Output only. \[Output Only\] One of EXTERNAL, INTERNAL to indicate whether the IP can be
accessed from the Internet. This field is always inherited from its
subnetwork.

Valid only if stackType is IPV4_IPV6.
Check the Ipv6AccessType enum for the list of possible values.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Ipv6Address

    public string Ipv6Address { get; set; }

An IPv6 internal network address for this network interface. To
use a static internal IP address, it must be unused and in the same region
as the instance's zone. If not specified, Google Cloud will automatically
assign an internal IPv6 address from the instance's subnetwork.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Kind

    public string Kind { get; set; }

Output only. \[Output Only\] Type of the resource. Alwayscompute#networkInterface for network interfaces.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Name

    public string Name { get; set; }

\[Output Only\] The name of the network interface, which is generated by the
server. For a VM, the network interface uses the nicN naming
format. Where N is a value between 0 and7. The default interface value is nic0.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Network

    public string Network { get; set; }

URL of the VPC network resource for this instance. When creating an
instance, if neither the network nor the subnetwork is specified, the
default network global/networks/default is used. If the
selected project doesn't have the default network, you must specify a
network or subnet. If the network is not specified but the subnetwork is
specified, the network is inferred.

If you specify this property, you can specify the network as
a full or partial URL. For example, the following are all valid URLs:

      - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
      - projects/project/global/networks/network
      - global/networks/default

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### NetworkAttachment

    public string NetworkAttachment { get; set; }

The URL of the network attachment that this interface should connect
to in the following format:
projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### NetworkIP

    public string NetworkIP { get; set; }

An IPv4 internal IP address to assign to the instance for this network
interface. If not specified by the user, an unused internal IP is
assigned by the system.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### NicType

    public string NicType { get; set; }

The type of vNIC to be used on this interface. This may be gVNIC or
VirtioNet.
Check the NicType enum for the list of possible values.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ParentNicName

    public string ParentNicName { get; set; }

Name of the parent network interface of a dynamic network interface.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### QueueCount

    public int QueueCount { get; set; }

The networking queue count that's specified by users for the network
interface. Both Rx and Tx queues will be set to this number. It'll be empty
if not specified by the users.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### ServiceClassId

    public string ServiceClassId { get; set; }

Optional. Producer Service's Service class Id for the region of this network
interface. Can only be used with network_attachment. It is not possible to
use on its own however, network_attachment can be used without
service_class_id.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### StackType

    public string StackType { get; set; }

The stack type for this network interface. To assign only IPv4 addresses,
use IPV4_ONLY. To assign both IPv4 and IPv6 addresses, useIPV4_IPV6. If not specified, IPV4_ONLY is used.

This field can be both set at instance creation and update network
interface operations.
Check the StackType enum for the list of possible values.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Subnetwork

    public string Subnetwork { get; set; }

The URL of the Subnetwork resource for this instance. If the network
resource is inlegacy
mode, do not specify this field. If the network is in auto subnet
mode, specifying the subnetwork is optional. If the network is in custom
subnet mode, specifying the subnetwork is required. If you specify this
field, you can specify the subnetwork as a full or partial URL. For
example, the following are all valid URLs:

      - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork

- regions/region/subnetworks/subnetwork

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Vlan

    public int Vlan { get; set; }

VLAN tag of a dynamic network interface, must be an integer in the range
from 2 to 255 inclusively.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |