공개 IP 연결은 소스 데이터베이스가 Google Cloud 외부에 있고 Google Cloud
외부적으로 액세스할 수 있는 IPv4 주소 및 TCP 포트가 있을 때 가장 적합합니다. 소스 데이터베이스가 Google Cloud의 다른 VPC에 호스팅되는 경우 소스 데이터베이스를 Cloud SQL 인스턴스에 연결하는 가장 쉬운 방법은 VPC 피어링을 사용하는 것입니다.
소스 데이터베이스가 Google Cloud외부에 있으면 대상 데이터베이스의 발신 IP 주소 (및 포트 5432)를 소스 네트워크에서 인바운드 방화벽 규칙으로 추가합니다. 네트워크 설정이 각 경우마다 다를 수 있지만 일반적으로 다음을 수행합니다.
소스 데이터베이스 머신의 네트워크 방화벽 규칙을 엽니다.
인바운드 규칙을 만듭니다.
규칙 유형을 PostgreSQL to AlloyDB로 설정합니다.
프로토콜을 TCP로 설정합니다.
포트 범위를 5432로 설정합니다.
소스 IP 주소를 대상 데이터베이스의 발신 IP 주소로 설정합니다. 예를 들면 12.20.36.126/32입니다. (CIDR 표기법의 /32 지정은 주소 범위를 제공된 주소 하나로 제한합니다. 서브넷 마스크를 255.255.255.255로 설정합니다. 만든 Cloud SQL 인스턴스가 고가용성 인스턴스인 경우 기본 인스턴스와 보조 인스턴스의 발신 IP 주소를 모두 포함합니다.
이 IP 주소의 연결을 허용하도록 pg_hba.conf 파일 또는 AWS RDS 보안 그룹을 업데이트합니다.
방화벽 규칙을 저장하고 종료합니다.
또한 소스에 전송되고 소스에서 수신되는 데이터가 안전하게 보호되도록 소스 연결 프로필을 정의할 때 SSL/TLS를 사용하는 것이 좋습니다.
[[["이해하기 쉬움","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-09-05(UTC)"],[[["\u003cp\u003ePublic IP connectivity is recommended when the source database is outside of Google Cloud and has a publicly accessible IPv4 address and TCP port.\u003c/p\u003e\n"],["\u003cp\u003eFor source databases external to Google Cloud, the destination database's outgoing IP address should be added as an inbound firewall rule on the source network, allowing TCP traffic on port 5432.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epg_hba.conf\u003c/code\u003e file or AWS RDS security groups should be updated to accept connections from the destination database's outgoing IP address.\u003c/p\u003e\n"],["\u003cp\u003eIt is highly recommended to use SSL/TLS to secure the data sent to and received by the source during the source connection profile definition.\u003c/p\u003e\n"]]],[],null,["# Configure connectivity using IP allowlists\n\n\u003cbr /\u003e\n\n[MySQL](/database-migration/docs/mysql/configure-connectivity-ip-allowlists \"View this page for the MySQL version of Database Migration Service.\") \\| [PostgreSQL](/database-migration/docs/postgres/configure-connectivity-ip-allowlists \"View this page for the PostgreSQL version of Database Migration Service.\") \\| PostgreSQL to AlloyDB\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nOverview\n--------\n\nPublic IP connectivity is most appropriate when the source database is external to Google Cloud\nand has an externally accessible IPv4 address and TCP port. If the source\ndatabase is hosted in another VPC in Google Cloud, then the easiest way to\nconnect the source database with the Cloud SQL instance is by using VPC Peering.\n\nIf your source database is external to Google Cloud, then add the destination database's **outgoing\nIP address** (and port 5432) as an inbound firewall rule on the source network. In\ngeneric terms (your specific network settings may differ), do the following:\n\n1. Open the source database machine's network firewall rules.\n\n2. Create an inbound rule.\n\n3. Set the Rule type to `PostgreSQL to AlloyDB`.\n\n4. Set the Protocol to `TCP`.\n\n5. Set the Port range to 5432.\n\n6. Set the Source IP address to the destination database's **outgoing IP address** . For example:\n `12.20.36.126/32`. (The /32 designation in CIDR notation limits the\n address range to one address only, the one provided. It's setting the subnet\n mask to `255.255.255.255`). If the Cloud SQL instance you created\n is a high availability instance, include the outgoing IP addresses for both\n the primary and the secondary instance.\n\n \u003cbr /\u003e\n\n\n Update the `pg_hba.conf` file or AWS RDS security groups to accept connections from this IP address.\n7. Save the firewall rule and exit.\n\n| You can test connectivity by adding another, temporary inbound firewall rule using the IP address of your local machine (or `0.0.0.0/0` to allow access from anywhere), and then running the following telnet command: `telnet [SOURCE_DB_IP_ADDRESS] 5432`. The connection should succeed. Delete the temporary firewall rule.\n\nIt's also highly recommended to use SSL/TLS during the definition of the source\nconnection profile so that the data sent to and received by the source is\nsecure."]]