Descripción general de la migración de las reglas de firewall de VPC
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Las reglas de firewall de la nube privada virtual (VPC) se aplican a una sola red de VPC. Para tener un control más preciso sobre el tráfico que envían o reciben las instancias de máquina virtual (VM) en la red de VPC, puedes usar etiquetas de red o cuentas de servicio en las reglas de firewall de VPC. Sin embargo, las reglas de firewall de VPC tienen las siguientes limitaciones:
No se editan por lotes: Las reglas de firewall de VPC se aplican por reglas y deben editarse de forma individual, lo que puede ser ineficiente.
Control de Identity and Access Management limitada (IAM): Las etiquetas de red no ofrecen los controles de IAM sólidos necesarios para una segmentación de tráfico estricta.
Para abordar las limitaciones de las reglas de firewall de VPC, Cloud Next Generation Firewall admite políticas de firewall de red globales y regionales. Puedes definir y aplicar políticas de firewall de red a varias redes de VPC en varias regiones. Estas políticas también admiten etiquetas seguras administradas por IAM que te permiten aplicar un control detallado a nivel de la VM para una microsegmentación segura y confiable de todos los tipos de tráfico de red.
Para controlar el acceso a tu red de VPC, puedes migrar las reglas de firewall de VPC existentes a una política de firewall de red global y aprovechar las capacidades de las políticas de firewall de red.
Beneficios de migrar las reglas de firewall de VPC a una política de firewall de red
Una política de firewall de red ofrece una experiencia de firewall coherente en toda la jerarquía de recursos deGoogle Cloud y ofrece varios beneficios operativos sobre las reglas de firewall de VPC.
Proporciona seguridad detallada y control de acceso con el uso de etiquetas controladas por IAM. Google Cloud Te permite adjuntar etiquetas independientes a cada interfaz de red de una VM. Según las etiquetas, puedes definir las reglas de la política de firewall para restringir el acceso no autorizado a los recursos y el tráfico de carga de trabajo. Por lo tanto, obtienes un nivel mayor de control sobre tus recursos, lo que ayuda a garantizar un entorno de autoservicio con privilegio mínimo para cada grupo de usuarios o aplicación. Las reglas de firewall de VPC usan etiquetas de red, que no son compatibles con el control de acceso de IAM.
Habilita la administración de reglas simplificada. Las políticas de firewall de red admiten la edición por lotes, lo que te permite editar varias reglas dentro de una sola política.
Las reglas de firewall de VPC operan solo a nivel de regla.
Proporciona facilidad de operaciones. Las políticas de firewall de red admiten el uso de funciones, como objetos de nombre de dominio completamente calificados (FQDN), objetos de ubicación geográfica, detección de amenazas, prevención de intrusiones, y grupos de direcciones.
Las reglas de firewall de VPC no son compatibles con estas funciones avanzadas.
Admite la residencia flexible de datos. Las políticas de firewall de red se pueden aplicar a varias regiones o a una sola región de una red.
Las reglas de firewall de VPC solo se pueden aplicar de forma global.
Herramienta de migración de reglas de firewall de VPC
La herramienta de migración de reglas de firewall de VPC puede migrar automáticamente las reglas de firewall de VPC a una política de firewall de red global. La herramienta es una utilidad de línea de comandos a la que puedes acceder a través de Google Cloud CLI.
Especificaciones
La herramienta de migración crea una política de firewall de red global, convierte las reglas de firewall de VPC existentes en reglas de políticas de firewall y agrega las reglas nuevas a la política.
Si dos o más reglas de firewall de VPC tienen la misma prioridad, la herramienta de migración actualiza de forma automática las prioridades de las reglas para evitar cualquier superposición.
Una regla con una acción deny tiene una prioridad mayor que una regla con una acción allow.
Mientras se actualizan las prioridades, la herramienta conserva la secuencia relativa de las reglas de firewall de VPC originales.
Por ejemplo, si tienes cuatro reglas de firewall de VPC con una prioridad de 1000 y una quinta regla con una prioridad de 2000, la herramienta de migración asigna un número de prioridad único a las primeras cuatro reglas con la secuencia: 1000, 1001, 1002 y 1003. La quinta regla con una prioridad de 2000 tiene asignada una nueva prioridad única de 1004. Esto garantiza que las prioridades nuevas para las primeras cuatro reglas sean superiores a las de todas las reglas con prioridad inferior a 1000.
Si tus reglas de firewall de VPC contienen dependencias, como etiquetas de red o cuentas de servicio, la herramienta de migración puede aprovechar las etiquetas administradas por IAM que sirven como reemplazo de esas etiquetas de red y cuentas de servicio.
Si tu red de VPC contiene reglas de firewall de VPC y una política de firewall de red asociada, la herramienta de migración mueve las reglas de firewall de VPC compatibles y las reglas de políticas de firewall de red a la nueva política de firewall de red global.
La herramienta de migración conserva la configuración de registro de las reglas de firewall de VPC existentes. Si una regla de firewall de VPC tiene activado el registro, la herramienta de migración lo mantiene activado. Si el registro está desactivado, la herramienta de migración lo mantiene desactivado.
La herramienta de migración solo genera la política de firewall de red global. La herramienta no borra las reglas de firewall de VPC existentes ni asocia la nueva política de firewall de red global con la red de VPC requerida. Debes asociar de forma manual la política de firewall de red global con la red de VPC requerida y, luego, quitar la asociación entre las reglas de firewall de VPC y la red de VPC.
Después de asociar la política de firewall de red global con la red de VPC requerida, puedes inhabilitar las reglas de firewall de VPC si las reglas de la política en la política de firewall de red global funcionan según lo previsto.
Si es necesario, puedes asociar la nueva política de firewall de red global y las reglas de firewall de VPC a la misma red de VPC, ya que las reglas se aplican según el orden de evaluación de políticas y reglas.
Sin embargo, te recomendamos inhabilitar las reglas de firewall de VPC.
Situaciones de migración
Ten en cuenta las siguientes situaciones cuando migres tus reglas de firewall de VPC a una política de firewall de red global:
En el siguiente diagrama, se muestra el flujo de trabajo de migración para las combinaciones de configuración anteriores. Elige el flujo de trabajo que coincida con tus requisitos de red.
Figura 1. Flujo de migración de las reglas de firewall de VPC (haz clic para ampliar).
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003eVPC firewall rules are limited to a single VPC network and lack batch editing capabilities and robust IAM controls, unlike network firewall policies.\u003c/p\u003e\n"],["\u003cp\u003eNetwork firewall policies offer enhanced control through IAM-governed secure tags, allowing for detailed micro-segmentation of network traffic at the VM level.\u003c/p\u003e\n"],["\u003cp\u003eNetwork firewall policies enable simplified management through batch editing, along with advanced features like FQDN and geolocation objects, which are not supported by VPC firewall rules.\u003c/p\u003e\n"],["\u003cp\u003eThe VPC firewall rules migration tool facilitates the conversion of existing VPC firewall rules into a global network firewall policy, automatically managing priorities and preserving log settings.\u003c/p\u003e\n"],["\u003cp\u003eMigrating to a global network firewall policy allows for greater flexibility in data residency, as it can be applied to multiple or single regions, whereas VPC firewall rules are applied globally.\u003c/p\u003e\n"]]],[],null,["# VPC firewall rules migration overview\n\nVirtual Private Cloud (VPC) firewall rules apply to a single VPC\nnetwork. To have finer control over the traffic sent or received by the virtual\nmachine (VM) instances in your VPC network, you can use\n[network tags](/vpc/docs/add-remove-network-tags) or [service accounts](/iam/docs/service-account-overview)\nin the VPC firewall rules. However, VPC firewall\nrules have the following limitations:\n\n- **No batch editing**: VPC firewall rules are applied on a\n per-rule basis and must be edited individually, which can be inefficient.\n\n- **Limited Identity and Access Management (IAM) control**: Network tags don't offer the\n robust IAM controls needed for strict traffic segmentation.\n\nTo address the limitations of VPC firewall rules,\nCloud Next Generation Firewall supports global and regional network firewall\npolicies. You can define and apply network firewall policies to multiple\nVPC networks across multiple regions. These policies also support\nIAM-governed [secure tags](/firewall/docs/tags-firewalls-overview) that let you enforce granular\ncontrol at the VM level for safe and reliable micro-segmentation of all types of\nnetwork traffic.\n\nFor more information, see [Benefits of migrating VPC firewall rules to a network firewall policy](#benefits).\n\nTo control access to your VPC network, you can migrate your existing VPC firewall rules to a global network firewall policy to take advantage of the capabilities of network firewall policies.\n\nBenefits of migrating VPC firewall rules to a network firewall policy\n---------------------------------------------------------------------\n\nA network firewall policy delivers a consistent firewall experience across the\nGoogle Cloud resource hierarchy and offers multiple operational benefits over\nVPC firewall rules.\n\n- **Provides granular security and access control by using IAM\n governed Tags**. Google Cloud lets you attach separate Tags to each\n network interface of a VM. Based on the Tags, you can define your firewall\n policy rules to restrict unauthorized access to your resources and workload\n traffic. So, you gain a finer level of control over your resources, which\n helps to ensure a least-privilege, self-service environment for each user\n group or application. VPC firewall rules use network tags,\n which don't support IAM access control.\n\n- **Enables simplified rule management**. Network firewall policies support\n batch editing, which lets you edit multiple rules within a single policy.\n VPC firewall rules operate only at a per-rule level.\n\n- **Provides ease of operations**. Network firewall policies support the use\n of features, such as fully qualified domain name (FQDN) objects,\n geolocation objects, threat detection, intrusion prevention, and address groups.\n VPC firewall rules don't support these advanced features.\n\n- **Supports flexible data residency**. Network firewall policies can be\n applied to either multiple regions or a single region of a network.\n VPC firewall rules can only be applied globally.\n\nVPC firewall rules migration tool\n---------------------------------\n\nThe VPC firewall rules migration tool can automatically migrate\nVPC firewall rules to a global network firewall policy. The tool\nis a command-line utility that you can access using the Google Cloud CLI.\n\n### Specifications\n\n- The migration tool creates a global network firewall policy, converts the\n existing VPC firewall rules into firewall policy rules, and\n adds the new rules to the policy.\n\n- If two or more VPC firewall rules have the same priority, the\n migration tool automatically updates the rule priorities to avoid any overlap.\n A rule with a `deny` action is given a higher priority than a rule with an `allow` action.\n While updating the priorities, the tool preserves the relative sequence of the\n original VPC firewall rules.\n\n For example, if you have four VPC firewall rules with a priority\n of `1000` and a fifth rule with a priority of `2000`, the migration tool\n assigns a unique priority number to the first four rules with the\n sequence---`1000`, `1001`, `1002`, and `1003`. The fifth rule with the\n priority of `2000` is assigned a new unique priority of `1004`. This ensures\n that the new priorities for the first four rules are higher than that of all\n rules that have priority lower than `1000`.\n | **Note:** Before you attach the new global network firewall policy to a VPC network, review the new priorities and make sure that the automatically generated priorities align with your original VPC network configuration.\n- If your VPC firewall rules contain dependencies, such as network\n tags or service accounts, the migration tool can take advantage of\n IAM-governed Tags that serve as a replacement to those network\n tags and services accounts.\n\n- If your VPC network contains VPC firewall\n rules and an associated network firewall policy, the migration tool moves\n the compatible VPC firewall rules as well as the network\n firewall policy rules to the new global network firewall policy.\n\n- The migration tool preserves the log settings of the existing VPC\n firewall rules. If a VPC firewall rule has logging turned on,\n the migration tool keeps it on. If logging is off, the migration tool keeps it turned off.\n\n- The migration tool generates the global network firewall policy only. The\n tool does not delete existing VPC firewall rules or associate\n the new global network firewall policy with the required VPC\n network. You must manually associate the global network firewall policy with\n the required VPC network, and then remove the association\n between the VPC firewall rules and the VPC\n network.\n\n- After you associate the global network firewall policy with the required\n VPC network, you can disable the VPC firewall\n rules if the policy rules in the global network firewall policy are working\n as intended.\n\n If necessary, you can associate the new global network firewall policy as well\n as the VPC firewall rules with the same VPC\n network because the rules are applied according to the [policy and rule\n evaluation order](/vpc/docs/firewall-policies-overview#rule-evaluation).\n However, we recommend you disable the VPC firewall rules.\n\nMigration scenarios\n-------------------\n\nConsider the following scenarios when you migrate your VPC firewall\nrules to a global network firewall policy:\n\n- [VPC firewall rules don't contain network tags or service accounts](/firewall/docs/migrate-firewall-rules-no-dependencies).\n- [VPC firewall rules contain network tags or target service accounts, or both](/firewall/docs/migrate-firewall-rules-with-dependencies).\n\nThe following diagram shows the migration workflow for the preceding configuration\ncombinations. Choose the workflow that matches your network requirements.\n[](/static/firewall/images/vpc-rules-migration.png) **Figure 1.** VPC firewall rules migration flow (click to enlarge).\n\nWhat's next\n-----------\n\n- [Migrate VPC firewall rules that don't use network tags and service accounts](/firewall/docs/migrate-firewall-rules-no-dependencies)\n- [Migrate VPC firewall rules that use network tags and service accounts](/firewall/docs/migrate-firewall-rules-with-dependencies)"]]