Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara mendapatkan kunci MACsec untuk MACsec untuk
Cloud Interconnect.
MACsec untuk Cloud Interconnect menghasilkan nilai kunci asosiasi konektivitas (CAK) dan nama kunci asosiasi konektivitas (CKN) GCM-AES-256. Anda
menggunakan nilai yang dihasilkan MACsec untuk Cloud Interconnect saat
mengonfigurasi router lokal. Anda bisa mendapatkan nilainya kapan saja setelah
mengonfigurasi kunci pra-bagi pada koneksi Cloud Interconnect.
Untuk mendapatkan izin yang diperlukan untuk mengambil kunci MACsec, minta administrator untuk memberi Anda peran IAM Compute Network Admin (roles/compute.networkAdmin) di project Anda.
Untuk mengetahui informasi selengkapnya tentang cara memberikan peran, lihat Mengelola akses ke project, folder, dan organisasi.
Jika Anda memilih untuk menggunakan peran khusus, pastikan bahwa peran khusus Anda untuk
mengelola MACsec untuk Cloud Interconnect menyertakan izin IAM
compute.interconnects.getMacsecConfig.
Dapatkan pre-shared key
Pilih salah satu opsi berikut:
Konsol
Di konsol Google Cloud , buka tab Koneksi fisik Cloud Interconnect.
Di tab MACsec, buka bagian Pre-shared keys dan temukan
nama kunci pra-bagi, lalu klik Tabel virtual. Jendela akan menampilkan
kunci asosiasi konektivitas (CAK) dan nama kunci
asosiasi konektivitas (CKN). Klik tombol Salin untuk menyalin setiap nilai ke
papan klip komputer Anda.
[[["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,["# Get MACsec keys\n\nThis page describes how to get your MACsec keys for\nMACsec for Cloud Interconnect.\n\nMACsec for Cloud Interconnect generates GCM-AES-256 connectivity\nassociation key (CAK) and connectivity association key name (CKN) values. You\nuse the values that MACsec for Cloud Interconnect generates when you\nconfigure your on-premises router. You can get the values at any time after\nconfiguring pre-shared keys on your Cloud Interconnect connection.\n\nFor more information, see\n[Configure your on-premises router](/network-connectivity/docs/interconnect/how-to/macsec/set-up-macsec#configure-your-on-premises-router).\n\nRequired roles\n--------------\n\n\nTo get the permissions that\nyou need to retrieve MACsec keys,\n\nask your administrator to grant you the\n\n\n[Compute Network Admin](/iam/docs/roles-permissions/compute#compute.networkAdmin) (`roles/compute.networkAdmin`)\nIAM role on your project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n\nIf you choose to use custom roles, ensure that your custom role for\nadministrating MACsec for Cloud Interconnect includes the\n`compute.interconnects.getMacsecConfig` IAM permission.\n\nGet pre-shared keys\n-------------------\n\nSelect one of the following options: \n\n### Console\n\n1. In the Google Cloud console, go to the Cloud Interconnect **Physical\n connections** tab.\n\n [Go to Physical connections](https://console.cloud.google.com/hybrid/interconnects/list?tab=interconnects)\n2. Select the connection that you want to view.\n\n3. On the **MACsec** tab, go to the **Pre-shared keys** section and find the\n name of the pre-shared key, and then click **View** . A window displays the\n connectivity association key (**CAK** ) and the connectivity association\n key name (**CKN** ). Click the **Copy** button to copy each value to your\n computer's clipboard.\n\n4. Click **Close**.\n\n### gcloud\n\nRun the following command: \n\n gcloud compute interconnects macsec get-config \u003cvar translate=\"no\"\u003eINTERCONNECT_CONNECTION_NAME\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eINTERCONNECT_CONNECTION_NAME\u003c/var\u003e with the name of your\nCloud Interconnect connection.\n\nThe output is similar to the following: \n\n preSharedKeys:\n - cak: 0123456789abcdef...0123456789abcdef\n ckn: 0101016789abcdef...0123456789abcdef\n name: key1\n startTime: 2023-07-01T21:00:01.000Z\n\nWhat's next?\n------------\n\n- [Rotate MACsec\n keys](/network-connectivity/docs/interconnect/how-to/macsec/rotate-macsec-keys)\n- [View MACsec status](/network-connectivity/docs/interconnect/how-to/macsec/view-macsec-status)\n- [Troubleshoot MACsec](/network-connectivity/docs/interconnect/how-to/macsec/troubleshoot-macsec)"]]