기본적으로 모든 컴퓨팅 인스턴스에는 인스턴스에서 사용하는 가상 프라이빗 클라우드 네트워크를 결정하는 하나 이상의 네트워크 인터페이스(vNIC)가 있습니다. 다중 네트워크 인터페이스가 있는 인스턴스를 만들 수 있습니다. RDMA 네트워크 프로필로 생성된 VPC 네트워크를 제외하고 각 네트워크 인터페이스는 고유한 VPC 네트워크의 서브넷에 할당되어야 합니다. 네트워크 인터페이스의 스택 유형과 서브넷의 스택 유형은 스택 유형 및 IP 주소에 설명된 대로 연동됩니다.
각 컴퓨팅 인스턴스는 RFC 3442에 정의된 대로 DHCP 옵션 121을 사용하여 기본 경로를 수신합니다. 기본 경로는 nic0
과 연결됩니다. 수동으로 달리 구성하지 않는 한 직접 연결된 서브넷을 제외한 모든 대상의 인스턴스에서 나가는 모든 트래픽은 nic0
의 기본 경로를 통해 나갑니다.
Linux 시스템에서는 /etc/iproute2/rt_tables
파일과 ip rule
, ip route
명령어를 사용하여 게스트 OS 내에서 커스텀 규칙과 경로를 구성할 수 있습니다. 자세한 내용은 게스트 OS 문서를 참조하세요. 예시를 보려면 추가 인터페이스의 라우팅 구성 튜토리얼을 참조하세요.
네트워크 인터페이스가 여러 개 필요하지 않은 경우 인스턴스 만들기 및 시작 절차를 따라 기본 네트워크 구성으로 인스턴스를 만듭니다.
시작하기 전에
- 컴퓨팅 인스턴스를 만들기 전에 필요한 모든 네트워크와 서브넷이 생성되었는지 확인하세요. 네트워크 또는 서브넷을 만들어야 하는 경우 VPC 네트워크 만들기 및 관리를 참조하세요.
- 각 네트워크에 여러 인터페이스가 있는 인스턴스와 데이터를 주고받을 수 있는 적절한 방화벽 규칙이 있는지 확인합니다. 방화벽 규칙을 만들어야 하는 경우 VPC 방화벽 규칙 사용을 참조하세요.
-
IPv6 주소를 사용하여 인스턴스를 여러 네트워크에 연결하는 경우
google-guest-agent
버전 20220603.00 이상을 설치하세요. 자세한 내용은 보조 인터페이스의 IPv6 주소에 연결할 수 없음을 참조하세요. -
아직 인증을 설정하지 않았다면 설정합니다.
인증은 Trusted Cloud by S3NS 서비스 및 API에 액세스하기 위해 ID를 확인하는 프로세스입니다.
로컬 개발 환경에서 코드 또는 샘플을 실행하려면 다음 옵션 중 하나를 선택하여 Compute Engine에 인증하면 됩니다.
Select the tab for how you plan to use the samples on this page:
Console
When you use the Trusted Cloud console to access Trusted Cloud by S3NS services and APIs, you don't need to set up authentication.
gcloud
-
After installing the Google Cloud CLI, sign in to the gcloud CLI with your federated identity and then initialize it by running the following command:
gcloud init
- Set a default region and zone.
- 프로젝트에 대한
compute.instances.create
권한 -
인스턴스의 서브넷 지정: 프로젝트 또는 선택한 서브넷에 대한
compute.subnetworks.use
권한 -
VPC 네트워크를 사용할 때 인스턴스에 외부 IP 주소 할당: 프로젝트 또는 선택한 서브넷에 대한
compute.subnetworks.useExternalIp
권한 - RDMA 네트워크 프로필로 생성된 VPC 네트워크를 제외하고 다음 제한사항이 적용됩니다. 여러 네트워크 인터페이스가 있는 인스턴스를 만드는 경우 각 인터페이스는 다른 VPC 네트워크에 연결되어야 합니다. 네트워크는 독립형 VPC 네트워크 또는 공유 VPC 네트워크일 수 있습니다.
- 각 네트워크 인터페이스는 고유한 서브넷 IP 주소 범위를 사용해야 합니다.
- 독립형 프로젝트의 다중 NIC 컴퓨팅 인스턴스의 경우 각 네트워크 인터페이스는 인스턴스와 동일한 프로젝트에 있는 서브넷을 사용해야 합니다. 공유 VPC 호스트 또는 서비스 프로젝트의 인스턴스는 가상 프라이빗 클라우드 문서의 공유 VPC 를 참조하세요. Private Service Connect 인터페이스를 사용하면 다중 NIC 인스턴스가 서로 다른 프로젝트의 서브넷에 네트워크 인터페이스를 가질 수 있습니다. 자세한 내용은 네트워크 연결 정보를 참조하세요.
- 인스턴스에 만들 수 있는 네트워크 인터페이스 수에 대한 자세한 내용은 최대 네트워크 인터페이스 수를 참조하세요.
- 인스턴스를 만들 때 Dynamic NIC를 구성할 수도 있습니다.
- Dynamic NIC의 VLAN ID는 2~255 사이의 정수여야 합니다.
- Dynamic NIC의 VLAN ID는 상위 vNIC 내에서 고유해야 합니다. 하지만 다른 상위 vNIC에 속한 Dynamic NIC가 동일한 VLAN ID를 사용할 수 있습니다.
- SSH 연결을 사용하여 인스턴스에 연결하는 방법 알아보기
- 내부 DNS를 사용하여 VM에 액세스
- VM의 PTR 레코드 만들기
REST
로컬 개발 환경에서 이 페이지의 REST API 샘플을 사용하려면 gcloud CLI에 제공한 사용자 인증 정보를 사용합니다.
After installing the Google Cloud CLI, sign in to the gcloud CLI with your federated identity and then initialize it by running the following command:
gcloud init
자세한 내용은 Trusted Cloud 인증 문서의 REST 사용을 위한 인증을 참조하세요.
필요한 역할
특정 서브넷으로 인스턴스를 만드는 데 필요한 권한을 얻으려면 관리자에게 프로젝트에 대한 Compute 인스턴스 관리자(v1)(
roles/compute.instanceAdmin.v1
) IAM 역할을 부여해 달라고 요청하세요. 역할 부여에 대한 자세한 내용은 프로젝트, 폴더, 조직에 대한 액세스 관리를 참조하세요.이 사전 정의된 역할에는 특정 서브넷으로 인스턴스를 만드는 데 필요한 권한이 포함되어 있습니다. 필요한 정확한 권한을 보려면 필수 권한 섹션을 펼치세요.
필수 권한
특정 서브넷으로 인스턴스를 만들려면 다음 권한이 필요합니다.
커스텀 역할이나 다른 사전 정의된 역할을 사용하여 이 권한을 부여받을 수도 있습니다.
요구사항
네트워크 인터페이스가 여러 개인 인스턴스를 만들기 전에 다음 요구사항을 검토하세요.
다수의 네트워크 인터페이스가 있는 VM 인스턴스 만들기
대부분의 Compute Engine 인스턴스에서는 인스턴스를 만들 때 여러 vNIC를 구성할 수 있습니다.
여러 네트워크 인터페이스가 있는 컴퓨팅 인스턴스를 만드는 방법은 다수의 네트워크 인터페이스가 있는 VM 인스턴스 만들기를 참조하세요.
기존 인스턴스에 네트워크 인터페이스 추가
인스턴스를 만들 때만 인스턴스의 가상 NIC(vNIC)를 구성할 수 있습니다. 하지만 기존 인스턴스에 Dynamic NIC를 추가하거나 삭제할 수 있으며 인스턴스를 다시 시작하지 않아도 됩니다.
Dynamic NIC는 상위 vNIC의 하위 인터페이스입니다. Dynamic NIC를 구성할 때는 Dynamic NIC의 네트워크 트래픽을 태그하는 데 사용되는 VLAN ID를 지정합니다.
Trusted Cloud by S3NS 는 Dynamic NIC의 이름에 다음 형식을 사용합니다.
PARENT_NIC_NUMBER.VLAN_ID
PARENT_NIC_NUMBER
는 상위 vNIC의 이름입니다(예:nic0
).VLAN_ID
는 Dynamic NIC를 구성할 때 지정한 번호입니다. Dynamic NIC 이름의 예는nic0.4
입니다.인스턴스에 Dynamic NIC를 추가하는 방법은 인스턴스에 Dynamic NIC 추가를 참조하세요.
다음 단계
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-30(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-30(UTC)"],[],[],null,["# Create VMs with multiple network interfaces\n\n*** ** * ** ***\n\nBy default, every compute instance has at least one network interface (vNIC)\nthat determines the Virtual Private Cloud network that the instance uses. You can\ncreate an instance with multiple network interfaces. Except for\nVPC networks that are created with an RDMA network profile, each\nnetwork interface must be assigned to a subnet in a unique VPC\nnetwork. The stack type of the network interface and the stack type of the\nsubnet work together as described in\n[Stack types and IP addresses](/vpc/docs/multiple-interfaces-concepts#stack-types)\n\nEach compute instance receives a default route using DHCP Option 121, as defined\nby [RFC 3442](https://datatracker.ietf.org/doc/html/rfc3442). The default route\nis associated with `nic0`. Unless manually configured otherwise, any traffic\nleaving an instance for any destination other than a directly connected subnet\nleaves the instance using the default route on `nic0`.\n\nOn Linux systems, you can configure custom rules and routes within the guest OS\nusing the `/etc/iproute2/rt_tables` file and the `ip rule` and `ip route`\ncommands. For more information, consult the guest OS documentation. For an\nexample, see the tutorial\n[Configure routing for an additional interface](/vpc/docs/configure-routing-additional-interface).\n\nIf you don't require multiple network interfaces, follow the procedure for\n[creating and starting an instance](/compute/docs/instances/create-start-instance)\nto create instances with the default network configuration.\n\nBefore you begin\n----------------\n\n- Verify that all required networks and subnets are created before you create the compute instance. If you need to create networks or subnets, see [Create and manage\n VPC networks](/vpc/docs/create-modify-vpc-networks).\n- Verify that each network has appropriate firewall rules that let data transfer to and from the instance that has multiple interfaces. If you need to create firewall rules, see [Use VPC firewall rules](/firewall/docs/using-firewalls).\n- If you are [connecting an\n instance to multiple networks by using IPv6 addresses](/vpc/docs/create-use-multiple-interfaces#example-dual), then install the `google-guest-agent` version [20220603.00](https://github.com/GoogleCloudPlatform/guest-agent/releases/tag/20220603.00) or later. For more information, see [I can't\n connect to a secondary interface's IPv6 address](/vpc/docs/troubleshoot-multiple-interfaces#connect-ipv6).\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n ### Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n ### gcloud\n\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n ### REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\n### Required roles\n\n\nTo get the permissions that\nyou need to create an instance with a specific subnet,\n\nask your administrator to grant you the\n\n\n[Compute Instance Admin (v1)](/iam/docs/roles-permissions/compute#compute.instanceAdmin.v1) (`roles/compute.instanceAdmin.v1`)\nIAM role on the project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThis predefined role contains\n\nthe permissions required to create an instance with a specific subnet. To see the exact permissions that are\nrequired, expand the **Required permissions** section:\n\n\n#### Required permissions\n\nThe following permissions are required to create an instance with a specific subnet:\n\n- ` compute.instances.create` on the project\n- To specify a subnet for your instance: ` compute.subnetworks.use` on the project or on the chosen subnet\n- To assign an external IP address to the instance when using a VPC network: ` compute.subnetworks.useExternalIp` on the project or on the chosen subnet\n\n\nYou might also be able to get\nthese permissions\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\n\nRequirements\n------------\n\nBefore you create an instance with multiple network interfaces, review the\nfollowing requirements:\n\n- Except for VPC networks that are created with an [RDMA network profile](/vpc/docs/rdma-network-profiles), the following limitation applies: If you create an instance with multiple network interfaces, each interface must connect to a different VPC network. The networks can be standalone [VPC networks](/vpc/docs/vpc) or [Shared VPC networks](/vpc/docs/shared-vpc).\n- Each network interface must use a unique subnet IP address range.\n- For multi-NIC compute instances in standalone projects, each network interface must use a subnet located in the same project as the instance. For instances in Shared VPC host or service projects, see [Shared VPC](/vpc/docs/multiple-interfaces-concepts#multiple-network-interfaces-in-shared-vpc) in the Virtual Private Cloud documentation. [Private Service Connect interfaces](/vpc/docs/about-private-service-connect-interfaces) provide a way for a multi-NIC instance to have network interfaces in subnets in different projects. For more information, see [About network attachments](/vpc/docs/about-network-attachments).\n\nCreate VM instances with multiple network interfaces\n----------------------------------------------------\n\nMost Compute Engine instances let you configure multiple vNICs when\ncreating the instance.\n\n- For information about the number of network interfaces you can create for an instance, see [Maximum number of network interfaces](/vpc/docs/multiple-interfaces-concepts#max-interfaces).\n- You can also configure [Dynamic NICs](/vpc/docs/multiple-interfaces-concepts#nic-types) when creating an instance.\n\nFor information about how to create a compute instance with multiple network\ninterfaces, see\n[Create VM instances with multiple network interfaces](/vpc/docs/create-use-multiple-interfaces#creating_virtual_machine_instances_with_multiple_network_interfaces).\n\nAdd network interfaces to an existing instance\n----------------------------------------------\n\nYou can configure virtual NICs (vNICs) for an instance only when creating the\ninstance. However, you can add or remove\n[Dynamic NICs](/vpc/docs/multiple-interfaces-concepts#nic-types)\nto an existing instance, and you don't have to restart the instance.\n\nDynamic NICs are subinterfaces of a parent vNIC.\nWhen you configure a Dynamic NIC, you specify\na VLAN ID that is used to tag network traffic for the\nDynamic NIC:\n\n- The VLAN ID of a Dynamic NIC must be an integer from 2 to 255.\n- The VLAN ID of a Dynamic NIC must be unique within a parent vNIC. However, Dynamic NICs that belong to different parent vNICs can use the same VLAN ID.\n\nGoogle Cloud uses the following format for the name of a\nDynamic NIC:\n\u003cvar translate=\"no\"\u003ePARENT_NIC_NUMBER\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003eVLAN_ID\u003c/var\u003e\n\n\u003cvar translate=\"no\"\u003ePARENT_NIC_NUMBER\u003c/var\u003e is the name of the parent vNIC, for example\n`nic0`. The \u003cvar translate=\"no\"\u003eVLAN_ID\u003c/var\u003e is the number you specified when\nconfiguring the Dynamic NIC. An example\nDynamic NIC name is `nic0.4`.\n\nFor information about how to add Dynamic NICs to an\ninstance, see\n[Add Dynamic NICs to an instance](/vpc/docs/add-dynamic-nics).\n\nWhat's next?\n------------\n\n- Learn how to use [SSH connections](/compute/docs/instances/ssh) to connect to your instance.\n- [Access VMs using internal DNS](/compute/docs/networking/using-internal-dns)\n- [Create a PTR record for a VM instance](/compute/docs/instances/create-ptr-record)"]] -