gcloud compute routes list \
--filter='(nextHopHub:*)'
Use o asterisco * para ver todas as rotas neste projeto com um campo nextHopHub não vazio. Para ver detalhes de uma rota, salve o nome dela na saída do comando e use-o para descrever uma rota em um projeto.
O resultado será assim:
NAME NETWORK DEST_RANGE NEXT_HOP PRIORITY
ncc-subnet-route-01db62e0-243a-5b2c-895d-9d4e0018b678 vpc-2 10.1.2.0/24 projects/_project_id_/locations/global/hubs/hub 0
Listar rotas para um spoke VPC específico
Para listar as rotas VPC de uma rede VPC específica, siga estas etapas.
Console
No Console do Google Cloud, acesse a página Rotas.
gcloud compute routes list \
--filter='(nextHopHub:*) AND (network:NETWORK)'
Use o asterisco * para ver todas as rotas neste projeto com um campo nextHopHub não vazio.
Substitua NETWORK pelo nome da rede VPC. Para ver detalhes de uma rota, salve o nome dela na saída do comando e use-o para descrever uma rota em um projeto.
O resultado será semelhante a este:
NAME NETWORK DEST_RANGE NEXT_HOP PRIORITY
ncc-subnet-route-01db62e0-243a-5b2c-895d-9d4e0018b678 vpc-2 10.1.2.0/24 projects/_project_id_/locations/global/hubs/hub 0
Descrever uma rota em um projeto
Para ver detalhes das rotas VPC de uma rede VPC específica, siga estas etapas.
Console
No Console do Google Cloud, acesse a página Rotas.
Substitua ROUTE_NAME pelo nome da rota dos detalhes que você quer visualizar. Os nomes dos trajetos são gerados automaticamente. Consiga o nome da rota na saída do comando gcloud compute routes list.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-28 UTC."],[],[],null,["# View the VPC route table\n\nThis page describes how to view VPC route tables. This page\nassumes that you are familiar with how to\n[list routes for a VPC network](/vpc/docs/using-routes#listingroutes).\n\n#### Permissions required for this task\n\nTo perform this task, you must have been granted the following permissions\n*or* the following IAM roles.\n\n**Permissions**\n\n- `compute.routes.list`\n\n**Roles**\n\nTo find predefined roles that contain those permissions, see [Compute Engine IAM roles and permissions](/compute/docs/access/iam).\n\nList and describe routes in a VPC spoke\n---------------------------------------\n\nYou can use the Google Cloud CLI or the API to list and view details about the\nfollowing types of routes:\n\n- [System-generated default routes](/vpc/docs/routes#routingpacketsinternet)\n- [Subnet routes](/vpc/docs/routes#subnet-routes)\n- [Peering subnet routes](/vpc/docs/routes#peering-subnet-routes)\n- [Network Connectivity Center subnet routes](/vpc/docs/routes#ncc-subnet-routes)\n- [Static routes](/vpc/docs/static-routes)\n\nNeither the gcloud CLI commands nor the API methods show the\nfollowing types of routes:\n\n- [Policy-based routes](/vpc/docs/routes#policy-based_routes)\n- [Dynamic routes](/vpc/docs/routes#dynamic_routes)\n- [Peering static and dynamic routes](/vpc/docs/routes#peering-custom-routes)\n\nTo see the complete route view, use the Google Cloud console. To list and\ndescribe policy-based routes, see [Use policy-based\nroutes](/vpc/docs/use-policy-based-routes). \n\n### Console\n\n1. In the Google Cloud console, go to the **Routes** page.\n\n [Go to Routes](https://console.cloud.google.com/networking/routes/list)\n2. On the **Effective routes** tab, do the following:\n\n - Choose a VPC network.\n - Choose a region.\n3. Click **View**.\n\n4. You can filter on properties including\n [route type](/vpc/docs/routes#types_of_routes), destination IP range,\n and [next hop type](/vpc/docs/routes#static-route-next-hops).\n\n5. Optional: Click the **Show suppressed routes** toggle to the on\n position to view routes that are suppressed. To view the reason why a\n route is suppressed, point to the icon in the **Status** column.\n\n### gcloud\n\nTo list and view details for [subnet routes](/vpc/docs/routes#subnet-routes)\nand [static routes](/vpc/docs/static-routes), use the [`gcloud compute\nroutes` commands](/sdk/gcloud/reference/compute/routes). These commands don't\nshow other types of routes. To see all routes, use the Google Cloud console.\n\nTo list routes, do the following: \n\n```\ngcloud compute routes list \\\n --filter=\"network=NETWORK_NAME\" \\\n --project=PROJECT_ID\n```\n\nTo get details for a route, do the following: \n\n```\ngcloud compute routes describe ROUTE_NAME \\\n --format=\"flattened()\" \\\n --project=PROJECT_ID\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eNETWORK_NAME\u003c/var\u003e: the name of the VPC network\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID that contains your VPC network\n- \u003cvar translate=\"no\"\u003eROUTE_NAME\u003c/var\u003e: the name of the route\n\n### API\n\nTo list and view details for [subnet routes](/vpc/docs/routes#subnet-routes)\nand [static routes](/vpc/docs/static-routes), use the\n[routes.list](/compute/docs/reference/rest/v1/routes/list) and\n[routes.get](/compute/docs/reference/rest/v1/routes/get) methods. These methods\ndon't show other types of routes. To see all routes, use the Google Cloud console.\n\nTo list routes, do the following: \n\n```\nGET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/routes?filter=network=\"NETWORK_URL\n```\n\nTo get details for a route, do the following: \n\n```\nGET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/routes/ROUTE_NAME\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID that contains your VPC network\n- \u003cvar translate=\"no\"\u003eNETWORK_URL\u003c/var\u003e: the URL of the VPC network\n- \u003cvar translate=\"no\"\u003eROUTE_NAME\u003c/var\u003e: the name of the route\n\nWhat's next\n-----------\n\n- To create hubs and spokes, see [Work with hubs and spokes](/network-connectivity/docs/network-connectivity-center/how-to/working-with-hubs-spokes).\n- To view a list of partners whose solutions are integrated with Network Connectivity Center, see [Network Connectivity Center partners](/network-connectivity/docs/network-connectivity-center/partners).\n- To find solutions for Router appliance issues, see [Troubleshooting](/network-connectivity/docs/network-connectivity-center/support/troubleshooting#troubleshooting-ra).\n- To get details about API and `gcloud` commands, see [APIs and reference](/network-connectivity/docs/network-connectivity-center/apis)."]]