Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Erweiterte VPC-Konzepte
Auf dieser Seite werden weitere Details zu VPC-Netzwerken (Virtual Private Cloud) erläutert.
Machen Sie sich vor dem Lesen dieser Seite mit den Informationen zu VPC-Netzwerken vertraut. Wenn Sie an Peering-VPC-Netzwerken interessiert sind, finden Sie weitere Informationen unter VPC-Netzwerk-Peering.
Details zum VPC-Netzwerk auf niedriger Ebene
Dieser Abschnitt enthält einige VPC-Netzwerkdetails.
Sie müssen diese für den normalen Gebrauch nicht lesen, aber sie geben einen Einblick in die Funktionsweise des VPC-Netzwerks. Im folgenden Diagramm werden diese Details beschrieben, wobei die entsprechenden Abschnitte weitere Informationen enthalten.
Das VPC-Netzwerk (zum Vergrößern anklicken)
Wer verarbeitet was
Die verschiedenen Features von VPC-Netzwerken werden von verschiedenen Teilen des Systems ausgeführt. Einige dieser Funktionen sind Standardnetzwerkfunktionen, die gut dokumentiert sind, während andere für VPC-Netzwerke spezifisch sind. Sie können einige Funktionen konfigurieren, andere hingegen nicht.
VPC-Netzwerke verwenden das VIRTIO-Netzwerkmodul von Linux zur Modellierung der Ethernetkarten- und Routerfunktion. Höhere Ebenen des Netzwerkstapels, wie etwa ARP-Suchvorgänge, werden aber mittels Standardnetzwerksoftware verarbeitet.
ARP-Suche
Der Instanz-Kernel gibt ARP-Anfragen und das VPC-Netzwerk ARP-Antworten aus. Die Zuordnung zwischen MAC-Adressen und IP-Adressen erfolgt durch den Instanz-Kernel.
Diese Tabellen werden im zugrunde liegenden VPC-Netzwerk gehostet und können nicht überprüft oder konfiguriert werden.
DNS-Server
Der Metadatenserver jeder Instanz fungiert als DNS-Server. Er speichert die DNS-Einträge für alle IP-Adressen des VPC-Netzwerks im lokalen VPC-Netzwerk und ruft den öffentlichen DNS-Server von Google für Einträge außerhalb des VPC-Netzwerks auf. Sie können diesen DNS-Server nicht konfigurieren. Der DHCP-Client jeder Instanz ist so konfiguriert, dass er die /etc/resolv.conf-Datei der Instanz verwaltet.
Sie können eine eigene Suchdomain oder Nameserver zur Instanz /etc/resolv.conf hinzufügen, indem Sie die DHCP-Richtlinie ändern. Bei vielen Linux-Distributionen können diese Änderungen über /etc/dhcp/dhclient.conf bestehen bleiben.
Weitere Informationen finden Sie in der Dokumentation Interne DNS.
Paketverarbeitung zwischen VPC-Netzwerk und außerhalb
Pakete in das oder aus dem VPC-Netzwerk werden von Netzwerkcode verarbeitet, der das Paket anhand von Firewallregeln, der Suchtabelle für externe IP-Adressen und der Tabelle aktiver Verbindungen untersucht. Das VPC-Netzwerk führt auch NAT für Pakete in und aus dem VPC-Netzwerk durch.
Von einer Instanz empfangene Pakete
Diese Pakete werden vom Instanz-Kernel nach der Standardmethode empfangen und in einen Stream umgewandelt.
Von einer Instanz gesendete Pakete
Pakete werden vom Instanz-Kernel nach der Standardmethode gesendet. Schnittstellen- und Netzwerkfunktion werden mit dem VIRTIO-Netzwerkmodul modelliert.
Detaillierte Verbindungsanleitungen
Im Folgenden wird beschrieben, was geschieht, wenn eine Instanz einen VPC-Netzwerkaufruf durchführt.
Eine Instanz führt einen Aufruf durch:
Wenn die Zieladresse ein Instanzname oder eine URL ist, wie etwa www.google.com, ruft die Instanz den DNS-Dienst über ihren Metadatenserver auf und gibt die entsprechende IP-Adresse zurück. Sie können die Instanz so konfigurieren, dass ein anderer DNS-Dienst abgefragt wird, aber dann können Sie keine Instanznamen auflösen.
Die Ziel-IP-Adresse wird anhand des IP-Adressbereichs des Subnetzes überprüft, den jede Instanz kennt.
Wenn die IP-Adresse nicht im aktuellen VPC-Netzwerk oder in einem VPC-Netzwerk mit VPC-Netzwerk-Peering enthalten ist:
Die Instanz sendet das Paket an die MAC-Adresse des Subnetz-Gateways, wobei das Ziel auf das endgültige Ziel des Pakets eingestellt ist. Die Instanz muss möglicherweise eine ARP-Anfrage stellen, um die MAC-Adresse des Gateways aufzulösen.
Das VPC-Netzwerk schreibt den IP-Header um, um die externe IP-Adresse der Instanz als Quelle zu deklarieren. Wenn die Instanz keine externe IP-Adresse hat, ist der Aufruf nicht zulässig und das VPC-Netzwerk löscht das Paket, ohne den Absender zu informieren.
Das VPC-Netzwerk zeichnet das ausgehende Paket auf und fügt Quelle und Ziel der Tabelle aktiver Verbindungen hinzu.
Das VPC-Netzwerk sendet das Paket an dessen Ziel.
Das Ziel ruft das Paket ab und antwortet gegebenenfalls.
Das VPC-Netzwerk empfängt die Antwort, prüft die Tabelle aktiver Verbindungen, stellt fest, dass es sich um eine aktive Verbindung handelt, und lässt diese zu. Das VPC-Netzwerk prüft die Netzwerk-/externe IP-Suchtabelle, ersetzt die externe IP-Adresse der Instanz durch die entsprechende Netzwerkadresse und sendet das Paket an die Quellinstanz.
Die Instanz empfängt das Paket.
Wenn sich die Ziel-IP-Adresse innerhalb des VPC-Netzwerks oder eines VPC-Netzwerks befindet, das über VPC-Netzwerk-Peering verbunden ist:
Die Instanz wird mit einer IP-Adresse mit 255.255.255.255-Maske konfiguriert, sodass die Instanz das Paket an die Gateway-MAC-Adresse des Subnetzes sendet. Die Instanz muss möglicherweise eine ARP-Anfrage stellen, um die MAC-Adresse des Gateways aufzulösen.
Google Cloud leitet das Paket an die Ziel-IP-Adresse im aktuellen oder im Peering-VPC-Netzwerk weiter.
Die Zielinstanz empfängt das Paket. Die Zielinstanz prüft die Firewall für eingehenden Traffic und bestimmt, ob das Paket zulässig ist. Wenn nicht, wird das Paket ohne Meldung gelöscht. Andernfalls verarbeitet die Instanz das Paket.
Eine externe Instanz oder ein externer Computer ruft eine Instanz auf:
Der externe Aufrufer sendet ein Paket an die externe IP-Adresse der Instanz, die dem VPC-Netzwerk gehört.
Das VPC-Netzwerk vergleicht das Paket mit der Tabelle aktiver Verbindungen, um zu prüfen, ob es sich um eine vorhandene Verbindung handelt:
Wenn es sich nicht um eine bestehende Verbindung handelt, sucht das VPC-Netzwerk nach einer Firewallregel, die die Verbindung zulässt.
Ist keine Firewallregel vorhanden, löscht das VPC-Netzwerk das Paket, ohne den Absender zu informieren.
Wenn eine Verbindung oder eine gültige Firewallregel vorhanden ist, prüft das VPC-Netzwerk die Suchtabelle und ersetzt die externe IP-Adresse durch die entsprechende interne IP-Adresse im Paket, protokolliert das eingehende Paket in der Tabelle aktiver Verbindungen und sendet das Paket an die Zielinstanz.
Das VPC-Netzwerk empfängt die Antwort, sucht die entsprechende eingehende Anfrage in der Tabelle aktiver Verbindungen und lässt die Weiterleitung des Pakets zu. Vor dem Senden ändert es die Quell-IP-Adresse. Dabei wird die interne IP-Adresse der Instanz durch die entsprechende externe IP-Adresse aus der Suchtabelle ersetzt.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-19 (UTC)."],[],[],null,["# Advanced VPC concepts\n=====================\n\nThis page goes into additional detail about Virtual Private Cloud (VPC) networks.\nBefore reading this page, see [VPC networks](/vpc/docs/vpc). If you are interested in peered VPC networks, see [VPC Network Peering](/vpc/docs/vpc-peering).\n\nLow-level VPC networking details\n--------------------------------\n\nThis section provides some low-level VPC networking details.\nYou do not need to read this for typical usage, but it provides more\ninsight about how VPC networking works. The following\ndiagram describes these low-level details, with more information in the\ncorresponding sections.\n[](/static/vpc/images/detailednetworkingdiagram.svg) The VPC network (click to enlarge).\n\n### Who handles what\n\nThe different VPC networking features are handled by\ndifferent parts of the system. Some of these are standard networking\nfeatures that are well documented, and some of them are specific to\nVPC networks. Some features you can configure, and some you cannot.\nVPC networks use Linux's\n[VIRTIO network module](http://dl.acm.org/citation.cfm?id=1400097.1400108)\nto model Ethernet card and router functionality, but higher levels of the\nnetworking stack, such as ARP lookups, are handled using standard networking\nsoftware.\n\nARP lookup\n: The instance kernel issues\n [ARP requests](https://wikipedia.org/wiki/Address_Resolution_Protocol)\n and the VPC network issues ARP replies. The mapping between MAC addresses and IP addresses\n is handled by the instance kernel.\n\nMAC lookup table, IP lookup table, active connection table\n: These tables are hosted on the underlying VPC network and cannot be inspected or\n configured.\n\nDNS server\n\n: Each instance's metadata server acts as a DNS server. It stores the DNS\n entries for all VPC network IP addresses in the local VPC network and calls\n Google's public DNS server for entries outside the VPC network. You cannot\n configure this DNS server. The DHCP client on each instance is configured to\n manage the instance's `/etc/resolv.conf` file.\n\n: You can add your own search domain or nameservers to the instance's\n `/etc/resolv.conf` by modifying the DHCP policy. Many Linux\n distributions allow these modifications to persist via\n [`/etc/dhcp/dhclient.conf`](https://www.isc.org/wp-content/uploads/2017/08/dhcp41clientconf.html).\n See the [Internal DNS](/compute/docs/internal-dns) documentation for more\n information.\n\nPacket handling between the VPC network and the outside\n\n: Packets coming into or out of the VPC network are handled by network code that\n examines the packet against firewall rules, against the external IP lookup table, and\n against the active connections table. The VPC network also performs NAT on packets\n coming into and out of the VPC network.\n\nPackets received by an instance\n\n: These packets are received and turned into a stream by the instance kernel in\n the standard fashion.\n\nPackets sent by an instance\n\n: Packets are sent by the instance kernel in the standard way. Interface\n and network functionality are modeled using the\n [VIRTIO network module](http://dl.acm.org/citation.cfm?id=1400097.1400108).\n\n### Detailed connection walkthroughs\n\nHere are more details about what happens when an instance makes a VPC\nnetwork call.\n\n**An instance makes a call:**\n\n1. If the target address is an instance name or a URL such as www.google.com, the instance calls the DNS service on its metadata server and gets back the matching IP address. You can configure your instance to consult another DNS service, but then you will not be able to resolve instance names.\n2. The destination IP address is examined against the subnet's IP address range,\n which every instance knows.\n\n 1. If the IP address is not in the\n current VPC network or in a VPC network\n peered using VPC Network Peering:\n\n 1. The instance sends the packet to the subnet's gateway MAC address\n with the destination set to the packet's final destination. The\n instance might need to make an ARP request to resolve the gateway's\n MAC address.\n\n 2. The VPC network\n rewrites the IP header to declare the instance's external IP address\n as the source. If the instance has no external IP address, the call\n is not allowed, and the VPC network drops the packet without informing\n the sender.\n\n 3. The VPC network records the outgoing packet and adds the source and\n destination to the active connections table.\n\n 4. The VPC network sends the packet on to its destination.\n\n 5. The destination gets the packet and responds if it chooses.\n\n 6. The VPC network receives the response, consults the active connections\n table, notes that this is an active connection, and allows it. The\n VPC network consults its network/external IP lookup table and replaces\n the instance's external IP address with the matching network\n address and sends the packet to the source instance.\n\n 7. The instance receives the packet.\n\n 2. If the destination IP address is within the VPC network\n or in a VPC network peered using VPC Network Peering:\n\n 1. The instance is configured with an IP with 255.255.255.255 mask,\n so the instance sends the packet to the subnet's gateway\n MAC address. The instance first might need to make an ARP request\n to resolve the gateway's MAC address.\n\n 2. Google Cloud forwards the packet to the destination IP address\n within the current or peered VPC network.\n\n 3. The target instance receives the packet. The target instance\n checks ingress firewall to determine if the packet is allowed. If\n not, the packet is dropped silently. Otherwise, the instance\n processes the packet.\n\n**An external instance or computer calls an instance:**\n\n1. The external caller sends a packet to an instance's external IP address, which\n is owned by the VPC network.\n\n2. The VPC network compares the packet against the active connections table to\n see whether this is an existing connection:\n\n 1. If it is not an existing connection, the VPC network looks for a firewall rule to allow the connection.\n 2. If there is no firewall rule, the VPC network drops the packet without informing the sender.\n3. If there is an existing connection or valid firewall rule, the VPC network examines\n its lookup table and replaces the external IP with the corresponding internal\n IP in the packet, logs the incoming packet in the active connections table,\n and sends the packet to the target instance.\n\n4. The instance receives the packet and responds as described in\n **[If the IP address is outside the VPC network IP range](#ip_outside_network)**\n when sending a packet outside the network range.\n\n5. The VPC network receives the reply, finds the matching incoming request in the\n active connections table, and allows the packet through. Before sending, it\n modifies the source IP address by replacing the instance's internal IP with\n the corresponding external IP from its lookup table.\n\nMeasure VPC network throughput\n------------------------------\n\nFor instructions, see\n[Calculate network throughput](/community/tutorials/network-throughput).\n\nWhat's next\n-----------\n\n- To learn about VPC networks, see [VPC networks](/vpc/docs/vpc).\n- To create, modify, and delete VPC networks, see [Create and manage VPC networks](/vpc/docs/create-modify-vpc-networks)."]]