External passthrough Network Load Balancer and Service Directory overview
Stay organized with collections
Save and categorize content based on your preferences.
You can choose to automatically register your external passthrough Network Load Balancer service with
Service Directory when you create an external passthrough Network Load Balancer. This enables client
applications to use Service Directory through HTTP, gRPC, or DNS to resolve the
address of the external passthrough Network Load Balancer service and connect to it directly.
Register an external passthrough Network Load Balancer with Service Directory
FORWARDING_RULE_NAME: a name for the forwarding rule
that you want to create
REGION: the region to create the forwarding rule in
RESERVED_IP_ADDRESS: the IP address that the forwarding
rule serves
PROTOCOL_TYPE: the IP protocol that the rule is to serve
PORT_NUMBER: a list of comma-separated ports
BACKEND_SERVICE_NAME: the target backend service that
receives the traffic
SD_SERVICE_NAME: the fully qualified name of the
Service Directory service where you want to register the endpoint. This
service must be in the same project and region as the forwarding rule being
created.
For example:
projects/PROJECT/locations/REGION/namespaces/NAMESPACE_NAME/services/SERVICE_NAME.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# External passthrough Network Load Balancer and Service Directory overview\n\nYou can choose to automatically register your external passthrough Network Load Balancer service with\nService Directory when you create an external passthrough Network Load Balancer. This enables client\napplications to use Service Directory through HTTP, gRPC, or DNS to resolve the\naddress of the external passthrough Network Load Balancer service and connect to it directly.\n\nRegister an external passthrough Network Load Balancer with Service Directory\n-----------------------------------------------------------------------------\n\nTo register an external passthrough Network Load Balancer, run the [`gcloud compute forwarding-rules\ncreate` command](/sdk/gcloud/reference/compute/forwarding-rules/create) and\nset the `service-directory-registration` flag: \n\n```\ngcloud beta compute forwarding-rules create FORWARDING_RULE_NAME \\\n --region=REGION \\\n --load-balancing-scheme=EXTERNAL \\\n --address=RESERVED_IP_ADDRESS \\\n --ip-protocol=PROTOCOL_TYPE \\\n --ports=PORT_NUMBER \\\n --backend-service=BACKEND_SERVICE_NAME \\\n --backend-service-region=REGION \\\n --service-directory-registration=SD_SERVICE_NAME\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eFORWARDING_RULE_NAME\u003c/var\u003e: a name for the forwarding rule that you want to create\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region to create the forwarding rule in\n- \u003cvar translate=\"no\"\u003eRESERVED_IP_ADDRESS\u003c/var\u003e: the IP address that the forwarding rule serves\n- \u003cvar translate=\"no\"\u003ePROTOCOL_TYPE\u003c/var\u003e: the IP protocol that the rule is to serve\n- \u003cvar translate=\"no\"\u003ePORT_NUMBER\u003c/var\u003e: a list of comma-separated ports\n- \u003cvar translate=\"no\"\u003eBACKEND_SERVICE_NAME\u003c/var\u003e: the target backend service that receives the traffic\n- \u003cvar translate=\"no\"\u003eSD_SERVICE_NAME\u003c/var\u003e: the fully qualified name of the Service Directory service where you want to register the endpoint. This service must be in the same project and region as the forwarding rule being created. For example: projects/\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e/namespaces/\u003cvar translate=\"no\"\u003eNAMESPACE_NAME\u003c/var\u003e/services/\u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e.\n\nWhat's next\n-----------\n\n- To learn more about Service Directory, see [Service Directory\n overview](/service-directory/docs/overview).\n- To learn about limitations of Service Directory integration with external passthrough Network Load Balancer and how to verify the endpoint, see [Register an external passthrough Network Load Balancer](/service-directory/docs/configuring-netlb-in-sd)."]]