Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mengupdate prioritas rute dasar
Saat mengonfigurasi sesi Border Gateway Protocol (BGP) di Cloud Router, Anda dapat menentukan prioritas dasar yang diberitahukan. Sebelum
memulai, pastikan Anda memahami Ringkasan rute
yang diiklankan Cloud Router.
Untuk mengetahui informasi selengkapnya tentang cara Cloud Router menggunakan prioritas dasar yang
diiklankan, lihat Prioritas
yang diiklankan.
Prioritas dasar adalah bilangan bulat dari 0 sampai 65535. Prioritas dasar tertinggi
adalah 0. Prioritas dasar default adalah 100. Jika Anda tidak menentukan prioritas dasar, prioritas default akan digunakan.
Prioritas dasar memungkinkan Anda menentukan tunnel Cloud VPN atau lampiran VLAN Cloud Interconnect di sistem lokal yang akan digunakan untuk mengirim paket ke jaringan VPC Anda. Anda dapat membuat kombinasi aktif-aktif, aktif-pasif, atau kustom dari topologi tersebut menggunakan prioritas dasar untuk memengaruhi cara paket dikirim ke jaringan VPC Anda.
Untuk contoh penggunaan tunnel VPN dengan ketersediaan tinggi (HA), lihat Opsi pemilihan rute aktif-aktif
dan aktif-pasif untuk VPN dengan ketersediaan tinggi (HA)
dalam dokumentasi Cloud VPN.
Saat memilih prioritas dasar, perhatikan hal-hal berikut:
Biaya region-ke-region adalah antara 201 dan 9999, inklusif. Nilainya bergantung pada jarak, latensi, dan faktor lain antara dua region.
Google membuat nilai biaya region-ke-region, dan Anda tidak dapat mengubahnya.
Prioritas dasar di antara Cloud Router di suatu region direkomendasikan untuk
berada antara 0 dan 200, inklusif. Karena biaya region-ke-region setidaknya 201, jika Anda menggunakan prioritas dasar 201 atau lebih, Anda mungkin tidak sengaja menetapkan tunnel Cloud VPN atau lampiran VLAN yang lebih rendah prioritas dari yang Anda inginkan. Sesi BGP lain di region berbeda mungkin
memberi tahu awalan yang sama dengan prioritas yang lebih tinggi secara keseluruhan (MED, yang sama dengan
prioritas dasar ditambah biaya region-ke-region). Tanpa menetapkan prioritas dasar di region lain dengan hati-hati, Anda dapat menyebabkan traffic lokal dikirim ke jaringan VPC melalui tunnel Cloud VPN atau lampiran VLAN yang tidak terduga.
Prioritas dasar 10200 atau lebih membantu memastikan bahwa prioritas dasar yang diberitahukan secara keseluruhan dari sebuah awalan (MED, prioritas dasar ditambah biaya region-ke-region) selalu lebih rendah daripada awalan lain yang diberitahukan dengan prioritas dasar 200 atau kurang.
Untuk mengupdate prioritas rute dasar yang diberitahukan untuk sesi BGP yang ada,
ikuti langkah-langkah berikut.
Konsol
Untuk tunnel Cloud VPN yang menggunakan perutean dinamis, termasuk
tunnel VPN dengan ketersediaan tinggi (HA), selesaikan langkah-langkah berikut:
Di konsol Google Cloud , buka halaman tunnel Cloud VPN.
Dari daftar lampiran di kolom Nama, pilih
lampiran yang ingin Anda ubah.
Di halaman Detail lampiran VLAN, pilih nama
sesi BGP.
Ubah nilai Prioritas rute yang diberitahukan.
Klik Simpan dan lanjutkan.
gcloud
Jalankan perintah update-bgp-peer menggunakan
flag --advertised-route-priority. Tentukan nama
Cloud Router dan sesi BGP yang sesuai dengan
tunnel Cloud VPN atau lampiran VLAN yang sesuai.
Gunakan metode
routers.patch
untuk memperbarui kolom bgpPeers[].
Kolom bgpPeers[] menerima array peer BGP. Saat melakukan PATCH pada
kolom ini, Anda akan menimpa array peer BGP yang ada dengan array baru
yang disertakan dalam permintaan Anda.
Kirim permintaan GET untuk mendapatkan array peer BGP saat ini untuk router.
Untuk mengetahui detailnya, baca
Melihat konfigurasi sesi BGP.
Kirim permintaan PATCH dengan array baru peer BGP.
Dalam elemen array yang berisi sesi BGP yang ingin Anda update,
ubah nilai advertisedRoutePriority.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-05 UTC."],[],[],null,["# Update the base route priority\n==============================\n\nWhen you configure a Border Gateway Protocol (BGP) session on a\nCloud Router, you can specify a base advertised priority. Before you\nbegin, ensure that you are familiar with the Cloud Router [Advertised\nroutes overview](/network-connectivity/docs/router/concepts/advertised-routes).\nFor more information about how Cloud Router uses the base advertised\npriority, see [Advertised\npriority](/network-connectivity/docs/router/concepts/advertised-routes#advertised-priority).\n\nBase priorities are whole numbers from `0` to `65535`. The highest possible base\npriority is `0`. The default base priority is `100`. If you don't specify a base\npriority, the default priority is used.\n\nBase priorities let you specify which Cloud VPN tunnels or\nCloud Interconnect VLAN attachments on-premises systems to use to send\npackets to your VPC network. You can create active-active,\nactive-passive, or a custom combination of these topologies by using the base\npriority to influence how packets are sent to your VPC network.\nFor an example using HA VPN tunnels, see [Active-active\nand active-passive routing options for\nHA VPN](/network-connectivity/docs/vpn/concepts/overview#active)\nin the Cloud VPN documentation.\n\nWhen choosing base priorities, keep the following in mind:\n\n- Region-to-region costs are between `201` and `9999`, inclusive. The value\n depends on the distance, latency, and other factors between two regions.\n Google generates the region-to-region cost values, and you can't modify\n them.\n\n- Base priorities among Cloud Routers in a region are recommended to\n be between `0` and `200`, inclusive. Because region-to-region costs are at\n least `201`, if you use base priorities of `201` or more, you might\n accidentally assign a Cloud VPN tunnel or VLAN attachment a lower\n priority than you intend. Another BGP session in a different region might\n advertise the same prefix with an overall higher priority (MED, which equals\n base priority plus region-to-region cost). Without carefully setting base\n priorities in other regions, you might cause on-premises traffic to be\n delivered to your VPC network by way of an unexpected\n Cloud VPN tunnel or VLAN attachment.\n\n- Base priorities of `10200` or more help ensure that a prefix's overall\n advertised priority (MED, base priority plus region-to-region cost) is\n always lower than any other advertised prefix with a base priority of `200`\n or less.\n\nTo update the base advertised route priority for an existing BGP session,\nfollow these steps. \n\n### Console\n\nFor Cloud VPN tunnels that use dynamic routing, including\nHA VPN tunnels, complete the following steps:\n\n1. In the Google Cloud console, go to the **Cloud VPN** tunnels page.\n\n [Go to Cloud VPN tunnels](https://console.cloud.google.com/hybrid/vpn/list?&tab=tunnels)\n2. From the list of tunnels in the **Name** column, select the\n tunnel that you want to modify.\n\n3. On the **Cloud VPN tunnel details** page, select\n **Modify BGP session**.\n\n4. Modify the **Advertised route priority** value.\n\n5. Click **Save and continue**.\n\nFor Dedicated Interconnect or Partner Interconnect,\ncomplete the following steps:\n\n1. In the Google Cloud console, go to the **VLAN attachments** tab on the\n **Cloud Interconnect** page.\n\n [Go to Cloud Interconnect](https://console.cloud.google.com/hybrid/interconnects/list?&tab=attachments)\n2. From the list of attachments in the **Name** column, select the\n attachment that you want to modify.\n\n3. On the **VLAN attachment details** page, select the name of the\n **BGP session**.\n\n4. Modify the **Advertised route priority** value.\n\n5. Click **Save and continue**.\n\n### gcloud\n\nRun the `update-bgp-peer` command using the\n`--advertised-route-priority` flag. Specify the name of the\nCloud Router and BGP session that correspond to the appropriate\nCloud VPN tunnel or VLAN attachment. \n\n```\ngcloud compute routers update-bgp-peer ROUTER_NAME \\\n --peer-name=NAME_OF_BGP_SESSION \\\n --advertised-route-priority=BASE_PRIORITY_VALUE\n```\n\n### API\n\nUse the\n[`routers.patch`](/compute/docs/reference/rest/v1/routers/patch)\nmethod to update the `bgpPeers[]` field.\n\nThe `bgpPeers[]` field accepts an array of BGP peers. When you `PATCH` this\nfield, you overwrite the existing array of BGP peers with the new array\nincluded in your request.\n\n1. Send a `GET` request to get the current array of BGP peers for the router.\n For details, see\n [View BGP session configuration](/network-connectivity/docs/router/how-to/viewing-router-details#bgp-configuration).\n\n2. Send a `PATCH` request with a new array of BGP peers.\n In the array element that contains the BGP session that you want to update,\n modify the value of `advertisedRoutePriority`.\n\n ```\n PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME\n {\n \"bgpPeers\": [\n BGP_PEERS\n ]\n }\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project that contains the Cloud Router\n - \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the Cloud Router is located\n - \u003cvar translate=\"no\"\u003eROUTER_NAME\u003c/var\u003e: the name of the Cloud Router\n - \u003cvar translate=\"no\"\u003eBGP_PEERS\u003c/var\u003e: the contents of the new array of BGP peers\n\n The following example includes one BGP peer with the default\n `advertisedRoutePriority` of `100` and another with an updated value\n of `99`: \n\n ```\n {\n \"name\": \"peer-1\",\n \"interfaceName\": \"if-peer-1\",\n \"ipAddress\": \"169.254.10.1\",\n \"peerIpAddress\": \"169.254.10.2\",\n \"peerAsn\": 64512,\n \"advertisedRoutePriority\": 100,\n \"advertiseMode\": \"DEFAULT\"\n },\n {\n \"name\": \"peer-2\",\n \"interfaceName\": \"if-peer-2\",\n \"ipAddress\": \"169.254.20.1\",\n \"peerIpAddress\": \"169.254.20.2\",\n \"peerAsn\": 64513,\n \"advertisedRoutePriority\": 99,\n \"advertiseMode\": \"DEFAULT\"\n }\n ```\n\nWhat's next?\n------------\n\n- To view the base advertised route priority, see\n [View Cloud Router details](/network-connectivity/docs/router/how-to/viewing-router-details).\n\n- To troubleshoot issues when using Cloud Router, see\n [Troubleshooting](/network-connectivity/docs/router/resources/troubleshooting)."]]