Cloud Router의 BGP 타이머 및 설정(온프레미스 라우터에 동일한 설정을 구성하는 방법 포함)
Cloud Router의 BGP 연결 유지 간격 업데이트
BGP 타이머 및 설정
Cloud Router와 온프레미스 라우터는 다음과 같은 타이머 설정을 사용하여 통신을 유지합니다.
연결 유지 타이머
BGP 시스템은 연결 유지 메시지를 교환하여 링크나 호스트에 장애가 실패했는지 또는 더 이상 사용할 수 없는지 확인합니다. 보류 타이머와 마찬가지로 연결 유지 타이머는 라우터를 BGP 피어에 연결할 수 있는지 여부를 나타냅니다.
연결 유지 타이머는 Cloud Router 및 그와 통신하는 온프레미스 피어 라우터 간에 교환되는 정기적인 BGP 메시지 간의 KEEPALIVE_INTERVAL입니다. BGP 연결 유지 간격 업데이트에 설명된 대로 이 값을 구성할 수 있습니다.
기본값은 20초입니다. 연결 유지 타이머를 온프레미스 라우터 및 Cloud Router에서 동일한 값으로 설정하는 것이 좋습니다.
보류 타이머
이 타이머는 마지막으로 성공한 연결 유지 메시지가 감지된 이후 대기하는 최소 시간을 추적합니다. Cloud Router 또는 온프레미스 라우터가 다른 라우터에서 학습한 경로를 삭제하기 전에 단계적 재시작 알림이 없는 경우 대기해야 하는 시간을 나타냅니다.
Cloud Router는 구성된 연결 유지 타이머 값에 3을 곱하여 이 값을 설정합니다. 예를 들어 연결 유지 타이머가 20초로 설정되어 있다면 보류 타이머는 60초로 설정됩니다. 마찬가지로, 온프레미스 라우터의 보류 타이머를 Cloud Router 연결 유지 타이머 설정값에 3을 곱한 값으로 설정합니다.
BGP 보류 타이머는 Cloud Router 및 온프레미스 라우터 간의 두 값 중 낮은 값으로 협상됩니다. Cloud Router는 BGP 보류 타이머의 기본값인 60초를 사용합니다. 이는 연결 유지 타이머 최솟값이 20초여야 하기 때문입니다. 온프레미스 라우터의 BGP 보류 타이머를 Cloud Router의 BGP 보류 타이머와 일치하거나 초과하도록 설정해야 합니다. 이렇게 하면 두 라우터 모두에서 유지보수 이벤트 중에 학습된 경로를 보존할 수 있습니다. 예를 들어 기본 BGP 보류 타이머를 사용하는 경우 온프레미스 보류 타이머를 60초 이상으로 설정해야 합니다.
단계적 재시작 타이머
이 타이머는 다른 라우터에서 단계적 재시작 알림 (TCP FIN 또는 RST 패킷)을 수신한 후 라우터가 대기하는 시간을 추적합니다. 단계적 재시작을 지원하는 라우터에서는 단계적 재시작 알림을 수신한 후 다른 라우터가 대기해야 하는 시간을 정의하는 단계적 재시작 타이머 값을 공지합니다. 두 피어 라우터에서 서로 다른 단계적 재시작 타이머 값을 사용할 수 있지만 라우터에 피어의 단계적 재시작 타이머 값이 적용되어야 합니다. 새 BGP 세션을 설정할 때 각 라우터에서 BGP OPEN 메시지를 통해 피어 라우터에 자체 단계적 재시작 타이머 값을 전달합니다.
Cloud Router는 단계적 재시작을 지원하며 Cloud Router 단계적 재시작 타이머는 120초로 설정됩니다. 모든 Cloud Router는 각 소프트웨어 유지보수 이벤트 전에 단계적 재시작 알림을 전송합니다.
온프레미스 라우터를 단계적 재시작으로 구성한 경우 온프레미스 라우터 재시작 또는 유지보수 이벤트 중에도 단계적 재시작 알림을 Cloud Router에 보낼 수 있습니다. 온프레미스 라우터의 단계적 재시작 타이머를 필요에 맞는 값으로 설정합니다.
비활성 경로 타이머
이 설정은 라우터가 다른 라우터에서 End-Of-Record(EOR) 메시지를 수신한 후 학습된 경로를 삭제할 때까지 대기하는 시간을 지정합니다. 이 타이머는 단계적 재시작 후 BGP 세션이 다시 초기화될 때 시작되지만, 문제의 프리픽스는 UPDATE 메시지로 해결되지 않습니다. Cloud Router의 설정과 일치하도록 온프레미스 라우터에서 비활성 경로 타이머를 300초로 설정하는 것이 좋습니다.
BGP 연결 유지 간격 업데이트
Cloud Router에서 BGP 연결 유지 간격을 수정하려면 다음 단계별 안내를 따르세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-31(UTC)"],[],[],null,["# Manage BGP timers\n=================\n\nThis page describes the following:\n\n- Cloud Router's BGP timers and their settings, including guidance for configuring the same settings on your on-premises router.\n- Updating the BGP keepalive interval for Cloud Router.\n\nBGP timers and settings\n-----------------------\n\nThe Cloud Router and your on-premises router maintain communication\nby using the following set of timer settings.\n\n### Keepalive timer\n\nBGP systems exchange keepalive messages to determine whether a link or host has\nfailed or is no longer available. In conjunction with the hold timer, the\nkeepalive timer indicates whether a router is reachable to its BGP peer.\n\nThe keepalive timer is the `KEEPALIVE_INTERVAL` between periodic BGP messages\nexchanged between a Cloud Router and its corresponding on-premises peer\nrouter. You can configure this value as described in\n[Update the BGP keepalive interval](#update-bgp-keepalive-interval).\nThe default value is 20 seconds. Google recommends setting the\nkeepalive timers to the same value on your on-premises router and the\nCloud Router.\n\n### Hold timer\n\nThis timer defines the amount of time that a Cloud Router or an\non-premises router must wait, absent a graceful restart notification (TCP `FIN`\nor `RST` packet) or a BGP `CEASE` notification, before moving the BGP session to\nthe `DOWN` state.\n\nRouters negotiate a hold time for each BGP session. The negotiated hold time\nis the lower of the hold timer values configured on Cloud Router and\nthe on-premises router. When the negotiated hold time is reached, and neither a\ngraceful restart notification nor a BGP `CEASE` notification has been received,\na router moves the BGP session to the `DOWN` state and takes the following\nactions:\n\n- Removes all learned routes from the BGP session\n- Stops advertising routes\n\nTo configure the Cloud Router hold timer, update the\nCloud Router BGP keepalive interval. Cloud Router sets the\nvalue of the hold timer to three times the value of the configured keepalive\ninterval. For example, if you set the keepalive timer to 20 seconds,\nthe hold timer is 60 seconds. For more information, see [Update the BGP\nkeepalive interval](#update-bgp-keepalive-interval).\n\n### Graceful restart timer\n\nThis timer defines the amount of time that a router preserves the previous BGP\nsession state following a graceful restart notification (TCP `FIN` or `RST`\npacket) from the peer router.\n\nWhile preserving the previous BGP session state, the router keeps the session's\nlearned routes received from the peer router and continues to advertise its\nroutes to the peer router. If a new BGP session is established while the\nprevious BGP session state is being preserved, there's no interruption to\nconnectivity. However, if a new BGP session isn't established, the session\ntransitions to the `DOWN` state at the end of the graceful restart timer. Once\nin the `DOWN` state, the session's learned routes received from the peer router\nare removed, and the router stops advertising its routes to the peer router.\n\nA router that supports graceful restart advertises a graceful restart timer\nvalue that defines the amount of time that the other router must wait following\na graceful restart notification. Two connected routers might use different\ngraceful restart timer values, and each router is expected to honor the graceful\nrestart timer value of its peer. When establishing a new BGP session, each\nrouter communicates its own graceful restart timer value to the peer router\nthrough the BGP `OPEN` message.\n\nCloud Router supports graceful restart, and the Cloud Router\ngraceful restart timer is set to 120 seconds. Every Cloud Router sends\na graceful restart notification before each [software\nmaintenance](/network-connectivity/docs/router/concepts/how-cloud-router-works#maintenance) event if\nthe peer router also supports graceful restart.\n\nIf you configured your on-premises router with graceful restart, it can also\nsend a graceful restart notification to the Cloud Router during\non-premises router restart or maintenance events. Set your on-premises router's\ngraceful restart timer to a value that is appropriate for your needs.\n\nFor more information about graceful restart, see [RFC\n4724](https://datatracker.ietf.org/doc/html/rfc4724).\n\n### Stalepath timer\n\nThis setting determines how long a router waits before deleting learned routes\nafter it receives an end-of-record (EOR) message from the other router. This\ntimer starts when the BGP session is reinitialized after\na graceful restart, but the prefix in question hasn't been addressed by an\n`UPDATE` message. We recommend setting the stalepath timer to 300 seconds on\nyour on-premises router to match the setting for the Cloud Router.\n\nUpdate the BGP keepalive interval\n---------------------------------\n\nTo modify the BGP keepalive interval on a Cloud Router, follow these\nsteps. \n\n### Console\n\n1. In the Google Cloud console, go to the **Cloud Routers** page.\n\n [Go to Cloud Routers](https://console.cloud.google.com/hybrid/routers/list)\n2. Select the Cloud Router that contains the BGP interval to\n modify.\n\n3. On the **Router details** page, click\n edit**Edit**.\n\n4. Update the **BGP peer keepalive interval**. This value must be an\n integer between 20 and 60 that specifies the number of seconds\n for the interval. The default is 20 seconds.\n\n5. Click **Save**.\n\n### gcloud\n\nRun the `update` command: \n\n```\ngcloud compute routers update ROUTER_NAME \\\n --project=PROJECT_ID \\\n --keepalive-interval=KEEPALIVE_INTERVAL \\\n --region=REGION\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eROUTER_NAME\u003c/var\u003e: the name of the Cloud Router\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project that contains the Cloud Router\n- \u003cvar translate=\"no\"\u003eKEEPALIVE_INTERVAL\u003c/var\u003e: the interval between BGP\n keepalive messages that are sent to the peer router\n\n This value must be an integer between 20 and 60 that specifies the\n number of seconds for the interval. The default is 20 seconds.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the Cloud Router\n is located\n\nThe output is similar to the following: \n\n```\n Updating router [my-router]...done.\n```\n\n### API\n\nUse the\n[`routers.patch`](/compute/docs/reference/rest/v1/routers/patch)\nmethod to update the `bgp.keepaliveInterval` field: \n\n```\n PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME\n {\n \"bgp\": {\n \"keepaliveInterval\": KEEPALIVE_INTERVAL\n }\n }\n```\n\nReplace the following:\n\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\"\u003eKEEPALIVE_INTERVAL\u003c/var\u003e: the interval between BGP\n keepalive messages that are sent to the peer router\n\n This value must be an integer between 20 and 60 that specifies the\n number of seconds for the interval. The default is 20 seconds.\n\nWhat's next\n-----------\n\n- To disable a BGP session temporarily or remove it entirely, see [Disable or remove BGP sessions](/network-connectivity/docs/router/how-to/disabling-removing-bgp).\n- To troubleshoot issues when using Cloud Router, see [Troubleshooting](/network-connectivity/docs/router/resources/troubleshooting)."]]