Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mengonfigurasi rentang ID BGP untuk Cloud Router
Setiap Cloud Router memiliki ID BGP, yang juga dikenal sebagai ID router.
ID BGP bersifat unik untuk setiap Cloud Router di jaringan Virtual Private Cloud (VPC) Anda seperti yang diwajibkan oleh RFC 6286. ID BGP adalah
bilangan bulat tanpa tanda tangan 4 octet, yang direpresentasikan sebagai alamat IPv4 yang valid.
Anda dapat menetapkan rentang ID BGP eksplisit ke Cloud Router.
Jika Anda melakukannya, Cloud Router akan diberi ID BGP yang stabil dari
rentang yang ditetapkan.
Rentang ID BGP eksplisit diperlukan untuk BGP IPv6. Jika Anda menambahkan antarmuka IPv6 ke Cloud Router yang belum memiliki rentang ID BGP yang ditetapkan, rentang acak dari ruang alamat link-local IPv4 akan ditetapkan ke antarmuka tersebut.
Cloud Router tanpa rentang ID BGP eksplisit akan diberi
ID BGP yang sesuai dengan alamat IPv4 terakhir secara leksikografis di antara
antarmuka IPv4-nya.
Perubahan ID BGP dan dimulai ulangnya sesi BGP
Kecuali jika Anda telah mengonfigurasi rentang ID BGP eksplisit, Cloud Router
dapat mengubah ID router yang dibuat secara otomatis dalam keadaan
berikut:
Anda menambahkan sesi BGP
Anda menghapus sesi BGP
Selama pemeliharaan berkala
Sebelum memulai
gcloud
Jika Anda ingin menggunakan contoh command line dalam panduan ini, lakukan tindakan berikut:
Nama: Nama Cloud Router. Nama ini
ditampilkan di konsol Google Cloud dan digunakan oleh
Google Cloud CLI untuk mereferensikan Cloud Router—misalnya, my-router.
Deskripsi: opsional. Deskripsi Cloud Router.
Jaringan: Jaringan VPC yang berisi instance yang ingin Anda jangkau—misalnya, my-network.
Region: Region tempat Anda ingin menemukan
Cloud Router—misalnya, asia-east1.
ASN Google: Apa pun
ASN pribadi
(64512-65534,
4200000000-4294967294) yang belum Anda
gunakan di jaringan lokal. Cloud Router mengharuskan Anda menggunakan ASN pribadi, tetapi ASN lokal Anda dapat bersifat publik atau pribadi.
Interval keepalive peer BGP: Interval antara dua pesan keepalive BGP berturut-turut yang dikirim ke router peer. Nilai ini
harus berupa bilangan bulat antara 20 dan 60 yang menentukan jumlah
detik untuk interval tersebut. Defaultnya adalah 20 detik. Untuk mengetahui informasi
selengkapnya, lihat
Mengelola timer BGP.
ID BGP: Opsional. ID BGP, yang terkadang disebut
ID router, yang secara unik mengidentifikasi Cloud Router di
jaringan. Jika dihilangkan, Cloud Router dengan sesi BGP IPv4 akan menggunakan salah satu alamat BGP IPv4 sebagai ID BGP, dan menambahkan antarmuka IPv6 pertama ke Cloud Router ini akan mengisi kolom secara otomatis.
Opsional: Untuk menentukan rute kustom yang diiklankan, buka bagian
Rute yang diiklankan. Untuk mengetahui informasi selengkapnya, lihat
Rute yang diiklankan.
Untuk menentukan Rute kustom, pilih Buat rute kustom.
Pilih apakah akan mengiklankan subnet yang terlihat oleh Cloud Router. Mengaktifkan opsi ini akan meniru perilaku default Cloud Router.
Untuk menambahkan rute yang diiklankan, pilih Tambahkan rute kustom, lalu
konfigurasikan.
Untuk menyimpan setelan dan membuat Cloud Router, klik
Buat. Cloud Router baru Anda akan muncul di halaman listingan Cloud Router. Untuk melihat detailnya dan
mengonfigurasi sesi BGP, pilih sesi BGP tersebut.
gcloud
Untuk menetapkan rentang ID BGP eksplisit saat membuat
Cloud Router, gunakan flag --bgp-identifier-range.
Ganti BGP_IDENTIFIER_RANGE dengan rentang IPv4 link-local
dari 169.254.0.0/16 dengan panjang awalan subnet mask maksimal /30.
Rentang alamat IPv4 tidak boleh tumpang-tindih dengan salah satu dari hal berikut:
Rentang alamat IPv4 yang digunakan oleh sesi BGP lain di Cloud Router ini.
Rentang ID BGP kustom apa pun yang digunakan oleh Cloud Router lain di jaringan dan region VPC yang sama.
Ganti BGP_IDENTIFIER_RANGE dengan rentang IPv4 link-local
dari 169.254.0.0/16 dengan panjang awalan subnet mask maksimal /30. Rentang
tidak boleh tumpang tindih dengan antarmuka Cloud Router IPv4
yang ada atau rentang ID BGP dari Cloud Router di region
yang sama.
Mengubah rentang ID BGP
Bagian ini menjelaskan cara mengubah rentang ID BGP eksplisit yang ada di Cloud Router.
gcloud
Untuk mengubah rentang ID BGP eksplisit, jalankan perintah berikut.
Ganti BGP_IDENTIFIER_RANGE dengan rentang IPv4 link-local
dari 169.254.0.0/16 dengan panjang awalan subnet mask maksimal /30.
Rentang alamat IPv4 tidak boleh tumpang-tindih dengan salah satu dari hal berikut:
Rentang alamat IPv4 yang digunakan oleh sesi BGP lain di Cloud Router ini.
Rentang ID BGP kustom apa pun yang digunakan oleh Cloud Router lain di jaringan dan region VPC yang sama.
[[["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-08-12 UTC."],[],[],null,["# Configure the BGP identifier range for a Cloud Router\n=====================================================\n\nEach Cloud Router has a BGP identifier, also known as a *router ID* .\nThe BGP identifier is unique to each Cloud Router in your\nVirtual Private Cloud (VPC) network as required by [RFC\n6286](https://datatracker.ietf.org/doc/html/rfc6286). A BGP identifier is\na 4-octet unsigned integer, represented as a valid IPv4 address.\n\nYou can assign an explicit BGP identifier *range* to your Cloud Router.\nIf you do, your Cloud Router is assigned a stable BGP identifier from\nthe assigned range.\n\nAn explicit BGP identifier range is required for IPv6 BGP. If you add an IPv6\ninterface to a Cloud Router that doesn't already have a BGP identifier\nrange assigned, a random range from the IPv4 link-local address space is\nassigned to it.\n\nA Cloud Router without an explicit BGP identifier range is assigned a\nBGP identifier corresponding to the lexicographically-last IPv4 address among\nits IPv4 interfaces.\n\nBGP identifier changes and BGP session restarts\n-----------------------------------------------\n\nUnless you've configured an explicit BGP identifier range, Cloud Router\nmight change the automatically generated router ID in the following\ncircumstances:\n\n- You add a BGP session\n- You remove a BGP session\n- During periodic maintenance\n\nBefore you begin\n----------------\n\n### gcloud\n\nIf you want to use the command-line examples in this guide, do the following:\n\n1. Install or update to the latest version of the [Google Cloud CLI](/compute/docs/gcloud-compute).\n2. Set a [default region and\n zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n### API\n\nIf you want to use the API examples in this guide, set up\n[API access](/compute/docs/api/prereqs).\n\nAssign a BGP identifier range to Cloud Router\n---------------------------------------------\n\nThis section describes how to assign an explicit BGP identifier range to a\nCloud Router. \n\n### Console\n\n1. In the Google Cloud console, go to the **Create a Cloud Router**\n page.\n\n [Go to Create a\n Cloud Router](https://console.cloud.google.com/hybrid/routers/add)\n2. Specify the Cloud Router's details:\n\n - **Name** : The name of the Cloud Router. This name is displayed in the Google Cloud console and is used by the Google Cloud CLI to reference the Cloud Router---for example, `my-router`.\n - **Description**: Optional. A description of the Cloud Router.\n - **Network** : The VPC network that contains the instances that you want to reach---for example, `my-network`.\n - **Region** : The region where you want to locate the Cloud Router---for example, `asia-east1`.\n -\n **Google ASN** : Any\n [private ASN](https://tools.ietf.org/html/rfc6996)\n (`64512`-`65534`,\n `4200000000`-`4294967294`) that you aren't already\n using in the on-premises network. Cloud Router requires that\n you use a private ASN, but your on-premises ASN can be public or\n private.\n\n\n | **Note:** If you are using Cloud Router with Partner Interconnect, you must specify the Google-owned public ASN `16550` instead.\n\n \u003cbr /\u003e\n\n - **BGP peer keepalive interval** : The interval between two successive BGP keepalive messages that are sent to the peer router. This value must be an integer between 20 and 60 that specifies the number of seconds for the interval. The default is 20 seconds. For more information, see [Manage BGP\n timers](/network-connectivity/docs/router/how-to/managing-bgp-timers).\n -\n **BGP identifier** : Optional. The BGP identifier, sometimes called a\n *router ID*, that uniquely identifies a Cloud Router in a\n network. If omitted, Cloud Routers with IPv4 BGP sessions use\n one of the IPv4 BGP addresses as the BGP identifier, and adding the\n first IPv6 interface to this Cloud Router populates the field\n automatically.\n\n\n For more\n information, see\n [Configure the BGP\n identifier range for a Cloud Router](/network-connectivity/docs/router/how-to/configure-bgp-identifier).\n3. Optional: To specify custom advertised routes, go to the **Advertised routes** section. For more information, see [Advertised routes](/network-connectivity/docs/router/concepts/advertised-routes).\n 1. To specify custom **Routes** , select **Create custom routes**.\n 2. Choose whether to advertise the subnets visible to the Cloud Router. Enabling this option mimics the Cloud Router's default behavior.\n 3. To add an advertised route, select **Add a custom route**, and then configure it.\n4. To save your settings and create a Cloud Router, click **Create**. Your new Cloud Router appears on the Cloud Router listing page. To view its details and to configure a BGP session, select it.\n\n### gcloud\n\nTo assign an explicit BGP identifier range when you create the\nCloud Router, use the `--bgp-identifier-range` flag. \n\n```\ngcloud compute routers create ROUTER_NAME \\\n --bgp-identifier-range=BGP_IDENTIFIER_RANGE\n```\n\nReplace \u003cvar translate=\"no\"\u003eBGP_IDENTIFIER_RANGE\u003c/var\u003e with a link-local IPv4 range\nfrom `169.254.0.0/16` with a subnet mask prefix length of at most `/30`.\nThe IPv4 address range must not overlap either of the following:\n\n- The IPv4 address range used by another BGP session on this\n Cloud Router.\n\n- Any custom BGP identifier range used by another\n Cloud Router in the same VPC network and region.\n\n### API\n\nUse the\n[`routers.insert` method](/compute/docs/reference/rest/v1/routers/insert): \n\n```\n POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME\n {\n \"bgp\": {\n \"asn\": \"ASN_NUMBER\",\n \"keepaliveInterval\": KEEPALIVE_INTERVAL,\n \"identifierRange\": BGP_IDENTIFIER_RANGE\n },\n \"name\": \"ROUTER_NAME\",\n \"network\": \"NETWORK\"\n }\n```\n\nReplace \u003cvar translate=\"no\"\u003eBGP_IDENTIFIER_RANGE\u003c/var\u003e with a link-local IPv4 range\nfrom `169.254.0.0/16` with a subnet mask prefix length of at most `/30`. The\nrange must not overlap with any existing IPv4 Cloud Router\ninterface or a BGP identifier range of a Cloud Router in the same\nregion.\n\nModify the BGP identifier range\n-------------------------------\n\nThis section describes how to modify an existing explicit BGP identifier\nrange on a Cloud Router.\n**Caution:** Changing the explicit BGP identifier range of Cloud Router causes all existing BGP sessions to restart for all BGP peers on the Cloud Router. \n\n### gcloud\n\nTo change the explicit BGP identifier range, run the following command. \n\n```\ngcloud compute routers update ROUTER_NAME \\\n --bgp-identifier-range=BGP_IDENTIFIER_RANGE\n```\n\nReplace \u003cvar translate=\"no\"\u003eBGP_IDENTIFIER_RANGE\u003c/var\u003e with a link-local IPv4 range\nfrom `169.254.0.0/16` with a subnet mask prefix length of at most `/30`.\n\nThe IPv4 address range must not overlap either of the following:\n\n- The IPv4 address range used by another BGP session on this\n Cloud Router.\n\n- Any custom BGP identifier range used by another\n Cloud Router in the same VPC network and region.\n\n### API\n\nUse the\n[`routers.patch` method](/compute/docs/reference/rest/v1/routers/patch)\nto update the `bgp.identifierRange` field: \n\n```\n PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME\n {\n \"bgp\": {\n \"identifierRange\": BGP_IDENTIFIER_RANGE\n }\n }\n```\n\nReplace \u003cvar translate=\"no\"\u003eBGP_IDENTIFIER_RANGE\u003c/var\u003e with a link-local IPv4 range\nfrom `169.254.0.0/16` with a subnet mask prefix length of at most `/30`.\nThe IPv4 address range must not overlap either of the following:\n\n- The IPv4 address range used by another BGP session on this\n Cloud Router.\n\n- Any custom BGP identifier range used by another\n Cloud Router in the same VPC network and region.\n\nWhat's next\n-----------\n\n- [View Cloud Router details](/network-connectivity/docs/router/how-to/viewing-router-details)"]]