Meta tags:
description= Set up an internal passthrough Network Load Balancer with VM instance group backends;
Headings (most frequently used words):
gcloud, console, api, configuration, load, configure, create, the, balancer, and, test, backend, your, vms, vm, instance, on, groups, client, with, backends, set, up, network, subnet, rules, use, traffic, ports, connection, start, basic, subnets, ipv6, region, firewall, components, ip, from, forwarding, frontend, review, an, internal, only, bash, script, using, global, access, address, accept, all, multiple, affinity, rule, to, setup, passthrough, group, stay, organized, collections, save, categorize, content, based, preferences, permissions, ipv4, dual, stack, additional, options, what, next, appendix, primer, install, tcp, server, startup, enable, managed, remove, external, addresses, reserved, two, session, tracking, policy, zonal, in, another, subsetting, for, packet, mirroring, products, pricing, support, resources, engage, ping, send, requests, balanced, connect, connectivity, new,
Text of the page (most frequently used words):
the (1147), network (351), and (339), load (290), for (283), compute (271), create (258), west1 (258), #backend (240), #internal (228), ipv6 (221), instance (219), subnet (206), balancer (200), click (197), name (189), allow (186), region (152), rule (144), address (143), you (143), https (140), gcloud (136), this (133), following (131), zone (128), projects (123), project_id (123), health (114), googleapis (113), com (113), vms (112), forwarding (110), cloud (104), group (101), instances (100), ilb (100), that (99), check (98), google (97), from (97), http (96), with (92), select (90), traffic (85), example (84), ports (83), stack (79), passthrough (78), rules (77), www (77), service (76), set (76), ssh (75), client (75), post (74), tcp (72), global (71), add (70), all (67), configure (66), groups (66), enter (65), configuration (64), firewall (64), ranges (64), server (62), use (62), only (61), console (61), range (58), ipv4 (57), networks (56), echo (56), two (55), information (54), type (53), access (53), request (52), page (50), default (50), section (50), balancing (49), regions (48), backends (48), source (46), can (46), test (46), 443 (46), vpc (45), port (45), tags (44), ingress (44), zones (43), dual (43), using (42), script (42), 8008 (40), apache2 (40), are (39), your (39), method (39), curl (39), 8080 (39), 8088 (39), overview (38), frontend (38), connections (38), then (37), see (36), command (36), ssl (36), false (36), external (36), etc (36), table (35), custom (35), connection (35), four (35), unmanaged (35), uses (34), subnetwork (34), debian (34), listen (34), socket (34), target (34), new (33), regional (33), nlisten (32), sed (32), these (31), insert (31), each (31), run (30), zonal (30), mode (30), managed (30), metadata (30), tee (30), direction (30), route (29), incoming (29), europe (29), more (28), local (28), how (28), checks (28), making (28), 8443 (28), prt_conf (28), ens4 (27), balancers (27), update (27), replace (26), ipprotocol (26), subnets (26), image (26), cat (26), services (25), connectivity (25), subnetworks (25), step (24), steps (24), next (24), protocol (24), any (24), conf (24), response (24), action (23), same (23), affinity (23), when (23), get (23), list (22), specified (22), startup (22), udp (22), api (22), file_ports (22), file_http_site (22), file_https_site (22), packets (21), interface (21), enable (21), choose (21), which (21), neg (21), fd20 (20), done (20), routing (19), dev (19), bash (19), options (19), note (19), addresses (19), html (19), 1000 (19), priority (19), available (18), forwardingrules (18), delete (18), vm_hostname (18), need (17), used (17), make (17), multiple (17), true (17), about (16), metric (16), pref (16), medium (16), connect (16), ephemeral (16), sites (16), indicated (16), protocols (16), instancegroups (16), firewalls (16), proto (15), created (15), networking (15), proxy (15), single (15), requests (15), because (15), beta (15), project (15), management (15), targets (15), policy (14), fe80 (14), creates (14), review (14), components (14), filter (14), assigned (14), http_listen_prts (14), http_vh_prts (14), https_listen_prts (14), https_vh_prts (14), prt_conf_2 (14), http_site_conf (14), http_site_conf_2 (14), https_site_conf (14), https_site_conf_2 (14), other (13), apache (13), bind (13), install (13), scheme (13), option (13), template (13), boot (13), specify (13), balanced (13), probe (13), allows (13), hybrid (13), vip (12), based (12), not (12), networktier (12), premium (12), second (12), edit (12), match (12), change (12), static (12), configured (12), repeat (12), startup_script_completed (12), apt (12), server_socket (12), policies (11), sudo (11), kernel (11), show (11), setup (11), application (11), backendservices (11), shows (11), settings (11), one (11), session (11), served (11), index (11), describe (11), url (11), applicable (11), within (11), architecture (10), support (10), its (10), 307 (10), 120c (10), 2000 (10), again (10), packet (10), want (10), advanced (10), required (10), demonstrate (10), spillover (10), tracking (10), behavior (10), values (10), purpose (10), accept (10), internet (10), family (10), bin (10), flavor (10), computemetadata (10), standard (10), ipv6_address (10), expected (10), listens (10), tag (10), system (9), send (9), 2ff (9), fe36 (9), ffbe (9), gateway (9), sends (9), named (9), identify (9), they (9), field (9), patch (9), subsetting (9), number (9), insecure (9), loadbalancingscheme (9), primary (9), verify (9), fields (9), must (9), disabled (9), flag (9), interfaces (9), var (9), ensure (9), like (9), combinations (9), ula (9), ipv4_ipv6 (9), buckets (9), code (8), content (8), via (8), should (8), parameters (8), blue (8), mark (8), before (8), have (8), distributed (8), shared (8), nat (8), 000 (8), _default_ (8), restart (8), disk (8), binds (8), listening (8), interface_name (8), body (8), close (8), necho (8), sourceranges (8), allowed (8), icmp (8), logconfig (8), thumb (7), mtu (7), after (7), different (7), troubleshoot (7), concepts (7), mirroring (7), start (7), specific (7), procedure (7), backendservice (7), version (7), either (7), ratio (7), also (7), automatically (7), remove (7), linux (7), items (7), images (7), located (7), separate (7), testing (7), python (7), virtual (7), contains (7), being (7), apply (7), web (7), guide (7), storage (7), negs (7), mtls (7), capabilities (7), resources (6), output (6), view (6), 100 (6), through (6), failover (6), collector_backend_service (6), where (6), mirror (6), basic (6), public (6), data (6), monitor (6), existing (6), ipaddress (6), finalize (6), there (6), continuing (6), zonal_affinity_spill_cross_zone (6), among (6), reserve (6), accepts (6), exit (6), a2ensite (6), a2enmod (6), systemctl (6), touch (6), gnu (6), demonstrates (6), actual (6), af_inet6 (6), forwarding_rule_vip (6), import (6), urllib (6), headers (6), specifies (6), server_address (6), print (6), client_socket (6), running (6), later (6), distribution (6), addinstances (6), health_check_ranges (6), serverless (6), premises (6), cross (6), terms (5), originating (5), subnet_range (5), matches (5), gateway_address (5), don (5), provide (5), connected (5), cannot (5), regionbackendservices (5), without (5), certificates (5), ipcidrrange (5), clients (5), work (5), instead (5), none (5), look (5), useful (5), maximum (5), necessary (5), connecting (5), client2 (5), machinetype (5), machinetypes (5), canipforward (5), networkinterfaces (5), accessconfigs (5), one_to_one_nat (5), disks (5), persistent (5), read_write (5), autodelete (5), devicename (5), initializeparams (5), sourceimage (5), disktype (5), disktypes (5), disksizegb (5), scheduling (5), preemptible (5), deletionprotection (5), described (5), file (5), always (5), contents (5), destination (5), targettags (5), prefix (5), ping (5), roles (5), troubleshooting (5), metrics (5), redirect (5), português (4), español (4), manage (4), contact (4), down (4), details (4), non (4), lookup (4), outgoing (4), defined (4), forward (4), expires (4), 256 (4), starting (4), logging (4), monitoring (4), dns (4), names (4), important (4), health_check_name (4), checkbox (4), facing (4), follow (4), security (4), might (4), self (4), works (4), persistence (4), unhealthy (4), supported (4), placeholders (4), both (4), shared_loadbalancer_vip (4), numbers (4), save (4), already (4), size (4), templates (4), optional (4), location (4), selected (4), bookworm (4), additional (4), them (4), ipv6_only (4), validate (4), correct (4), simple (4), library (4), thank (4), closes (4), key (4), so_bindtodevice (4), programming (4), get_vm_hostname (4), req (4), sock_stream (4), so_reuseaddr (4), setsockopt (4), sol_socket (4), encode (4), client_address (4), 200 (4), handle (4), times (4), automatic (4), 2600 (4), 2d00 (4), b029 (4), sources (4), manually (4), stacktype (4), balancingmode (4), healthchecks (4), regionhealthchecks (4), napt (4), nprt_conf (4), identical (4), simplicity (4), software (4), 130 (4), 211 (4), 191 (4), ula_ipv6_range (4), guides (4), tools (4), maps (4), logs (4), terraform (4), examples (4), third (3), samples (3), status (3), products (3), last (3), under (3), sysctl (3), net (3), ip_nonlocal_bind (3), follows (3), adds (3), 1460 (3), referenced (3), link (3), provides (3), description (3), commands (3), configuring (3), requires (3), case (3), feature (3), observe (3), signed (3), privateipgoogleaccess (3), another (3), zonal_affinity_stay_within_zone (3), product (3), features (3), timeout (3), rest (3), reference (3), reserved (3), let (3), column (3), common (3), over (3), error (3), current (3), permit (3), allocated (3), download (3), such (3), machine (3), autohealing (3), usage (3), autoscaling (3), production (3), appears (3), enlarge (3), contacts (3), serve (3), text (3), learn (3), appropriate (3), having (3), nature (3), placed (3), omit (3), interprets (3), mean (3), systems (3), blocks (3), deny (3), restrictive (3), just (3), sessions (3), creation (3), private (3), document (3), pass (3), value (3), deliver (3), however (3), comma (3), separated (3), formatted (3), quoted (3), strings (3), communication (3), internalipv6range (3), consider (3), documentation (3), back (3), implemented (3), guest (3), itself (3), responses (3), iam (3), admin (3), engine (3), tls (3), explore (3), tutorials (3), directory (3), registration (3), migrate (3), classic (3), 한국어 (2), 日本語 (2), עברית (2), brasil (2), italiano (2), indonesia (2), français (2), américa (2), latina (2), deutsch (2), english (2), sign (2), site (2), youtube (2), started (2), pricing (2), understand (2), updated (2), 2026 (2), utc (2), licensed (2), license (2), feedback (2), added (2), main (2), 1024 (2), 89sec (2), 24ff (2), feb1 (2), 59b3 (2), multicast (2), ff00 (2), previous (2), 62sec (2), outlined (2), appendix (2), clean (2), accessing (2), fundamentals (2), forwarding_rule_name (2), collector (2), instance_group (2), order (2), lets (2), performance (2), consistent_hash_subsetting (2), specifying (2), scale (2), handled (2), regardless (2), including (2), subject (2), sections (2), pre (2), seconds (2), entry (2), idle_timeout_value (2), connection_persistence_behavior (2), tracking_mode (2), updating (2), backend_service (2), valid (2), idle (2), cli (2), client_ip (2), setting (2), certificate (2), replacement (2), handling (2), alternative (2), strategy (2), installs (2), configures (2), remain (2), adding (2), assign (2), reservation (2), promote (2), deleteaccessconfig (2), replacing (2), config (2), determine (2), removing (2), directly (2), multi (2), modify (2), allowglobalaccess (2), enabled (2), has (2), reboot (2), find (2), sets (2), handles (2), loop (2), binding (2), accepting (2), sending (2), write (2), locally (2), fetch (2), hostname (2), def (2), urlopen (2), return (2), read (2), decode (2), object (2), reusing (2), avoid (2), errors (2), restarting (2), interface_index (2), if_nametoindex (2), argument (2), queued (2), message (2), indicating (2), ready (2), bound (2), while (2), accepted (2), generate (2), construct (2), proper (2), length (2), len (2), plain (2), sendall (2), eof (2), executable (2), chmod (2), python3 (2), stored (2), root (2), folder (2), earlier (2), going (2), takes (2), few (2), minutes (2), scope (2), needs (2), initiate (2), bgp (2), prompted (2), allocate (2), complete (2), fixed (2), cidr (2), block (2), supports (2), 1db0 (2), b882 (2), 802 (2), connectiondraining (2), drainingtimeoutsec (2), httphealthcheck (2), although (2), na2ensite (2), na2enmod (2), nfile_ports (2), nfile_http_site (2), nfile_https_site (2), nhttp_listen_prts (2), nhttp_vh_prts (2), nhttps_listen_prts (2), nhttps_vh_prts (2), nvm_hostname (2), nhttp (2), 169 (2), 254 (2), ntee (2), nprt_conf_2 (2), nhttp_site_conf (2), nhttp_site_conf_2 (2), nhttps_site_conf (2), nhttps_site_conf_2 (2), nsystemctl (2), debian_image_name (2), instructional (2), associated (2), delivered (2), preserving (2), runs (2), 192 (2), 198 (2), ipv6accesstype (2), refer (2), control (2), dynamic_routing_mode (2), selects (2), transmission (2), unit (2), 1500 (2), autocreatesubnetworks (2), enableulainternalipv6 (2), routingconfig (2), routingmode (2), assigns (2), illustrated (2), parameter (2), hops (2), routed (2), makes (2), way (2), sent (2), operating (2), those (2), will (2), conditions (2), task (2), permissions (2), sdk (2), languages (2), frameworks (2), infrastructure (2), costs (2), observability (2), migration (2), industry (2), solutions (2), multicloud (2), databases (2), analytics (2), pipelines (2), hosting (2), development (2), pools (2), optimizations (2), authorization (2), workload (2), identity (2), pool (2), convert (2), capacity (2), app (2), functions (2), constraints (2), technology (2), areas (2), subscribe, newsletter, our, decade, climate, join, cookies, privacy, tech, twitter, events, blog, engage, training, certification, center, getting, github, release, notes, community, forums, sales, marketplace, easy, easytounderstand, solved, problem, solvedmyproblem, otherup, hard, hardtounderstand, incorrect, sample, incorrectinformationorsamplecode, missing, missingtheinformationsamplesineed, otherdown, tell, except, otherwise, noted, java, registered, trademark, oracle, affiliates, developers, creative, commons, attribution, line, telling, 32765, 32766, were, pointing, routes, brief, related, here, context, aid, understanding, primer, issues, peer, what, l3_default, configurations, balance, destinations, copy, collect, collected, help, detect, threats, does, than, 250, enabling, temporarily, disruptive, break, caution, deployment, larger, nonzero, zero, offerings, general, limited, launch, stage, descriptions, preview, maintained, processes, matched, sec, docs, includes, sessionaffinity, types, hash, prefixlength, addresstype, supporting, five, fewer, allports, whose, keyword, hold, pointer, try, encounter, conflicting, resource_type, forwarding_rule, resource_name, existing_forwarding_rule_name, six, certain, determines, component, unlike, doesn, reserving, alternatively, accessconfig, networkinterface, limits, leave, was, could, their, prevents, disconnect, optionally, minimum, autoscale, require, simpler, distribute, did, word, format, whether, include, says, changes, accessible, still, expands, tasks, perform, nano, indicates, serves, called, ipversion, 2001, db8, advertisement, routers, dynamic, bc7, 9a1c, add_box, diagram, means, instructions, creating, originated, grep, inspect, looking, part, but, why, behind, responded, comes, repeated, answered, won, able, removed, processed, environment, state, attempt, notice, out, devices, il4, label, append, colon, come, generating, displayed, virtue, been, tests, equivalent, time, initiating, allowing, looks, subsequent, instanceadmin, securityadmin, networkadmin, role, owner, editor, guidance, teach, familiarize, yourself, categorize, preferences, stay, organized, collections, home, audit, operate, maintain, map, quota, units, proxies, endpoint, draining, customize, quantum, authenticated, user, provided, mutual, encryption, secure, switch, between, deploy, hub, spoke, hop, party, appliances, weighted, optimize, latency, published, domain, faster, improved, protection, best, practices, fail, high, availability, rewrite, header, query, roll, bucket, organization, comparison, resource, model, discover, free, skip,
Text of the page (random words):
nstance that you need to update click edit in the metadata section enter the following script in the startup script field note the server script server py referenced in the bash script is stored in the root folder of your backend vm bin bash replace these with your actual values run the ip 6 route show table all command to find the correct values gateway_address fe80 57 2ff fe36 ffbe subnet_range fd20 307 120c 2000 64 add a custom default route to routing table 1 the following command sends packets to the gateway using the network interface named ens4 sudo ip route add default via gateway_address dev ens4 table 1 add a source based policy routing rule the following command adds a rule to route all outgoing packets originating from a specified subnet if the source address matches the subnet the system uses the default route defined in table 1 to forward the traffic sudo ip 6 rule add from subnet_range table 1 allow the server to bind to a non local ipv6 address the vip of the load balancer sudo sysctl w net ipv6 ip_nonlocal_bind 1 overview this script sets up a simple ipv6 tcp server using python s socket library the server binds to a specific network interface and listens on a specified virtual ip vip address and port default 80 it accepts incoming client connections sends a simple response thank you for connecting and then closes the connection key features uses ipv6 af_inet6 for networking binds to a specific network interface using so_bindtodevice handles multiple client connections in a loop demonstrates basic socket programming concepts like binding listening accepting and sending data note replace placeholders like forwarding_rule_vip and ens4 with actual values for your setup write the python file locally cat server py import the socket library to work with network connections import socket import urllib request fetch the vm hostname from google cloud metadata server def get_vm_hostname url http metadata google internal computemetadata v1 instance name req urllib request request url headers metadata flavor google with urllib request urlopen req as response return response read decode vm_hostname get_vm_hostname create a socket object for ipv6 and tcp connections af_inet6 specifies ipv6 sock_stream specifies tcp server_socket socket socket socket af_inet6 socket sock_stream set the so_reuseaddr option to allow reusing the address this is useful to avoid address already in use errors when restarting the server server_socket setsockopt socket sol_socket socket so_reuseaddr 1 specify the network interface to bind the server to replace ens4 with the name of your network interface interface_name ens4 get the index of the network interface interface_index socket if_nametoindex interface_name bind the socket to the specified network interface server_socket setsockopt socket sol_socket socket so_bindtodevice interface_name encode bind the socket to an address and port replace forwarding_rule_vip with the actual vip virtual ip address server_address forwarding_rule_vip 80 0 0 server_socket bind server_address start listening for incoming connections the argument 5 specifies the maximum number of queued connections server_socket listen 5 print a message indicating that the server is ready to accept connections print f server listening on server_address bound to interface_name serve incoming connections while true client_socket client_address server_socket accept print f accepted connection from client_address generate response body body f thank you for connecting to vm_hostname n construct a proper http 1 1 response response http 1 1 200 ok r n f content length len body r n content type text plain r n connection close r n r n f body send the response and close the connection client_socket sendall response encode client_socket close eof make the python script executable chmod x server py run the server sudo python3 server py click save reboot the instance gcloud create a startup script nano startup sh add the following script and save the file note the server script server py referenced in the bash script is stored in the root folder of your backend vm bin bash replace these with your actual values run the ip 6 route show table all command to find the correct values gateway_address fe80 57 2ff fe36 ffbe subnet_range fd20 307 120c 2000 64 add a custom default route to routing table 1 the following command sends packets to the gateway using the network interface named ens4 sudo ip route add default via gateway_address dev ens4 table 1 add a source based policy routing rule the following command adds a rule to route all outgoing packets originating from a specified subnet if the source address matches the subnet the system uses the default route defined in table 1 to forward the traffic sudo ip 6 rule add from subnet_range table 1 allow the server to bind to a non local ipv6 address the vip of the load balancer sudo sysctl w net ipv6 ip_nonlocal_bind 1 overview this script sets up a simple ipv6 tcp server using python s socket library the server binds to a specific network interface and listens on a specified virtual ip vip address and port default 80 it accepts incoming client connections sends a simple response thank you for connecting and then closes the connection key features uses ipv6 af_inet6 for networking binds to a specific network interface using so_bindtodevice handles multiple client connections in a loop demonstrates basic socket programming concepts like binding listening accepting and sending data note replace placeholders like forwarding_rule_vip and ens4 with actual values for your setup write the python file locally cat server py import the socket library to work with network connections import socket import urllib request fetch the vm hostname from google cloud metadata server def get_vm_hostname url http metadata google internal computemetadata v1 instance name req urllib request request url headers metadata flavor google with urllib request urlopen req as response return response read decode vm_hostname get_vm_hostname create a socket object for ipv6 and tcp connections af_inet6 specifies ipv6 sock_stream specifies tcp server_socket socket socket socket af_inet6 socket sock_stream set the so_reuseaddr option to allow reusing the address this is useful to avoid address already in use errors when restarting the server server_socket setsockopt socket sol_socket socket so_reuseaddr 1 specify the network interface to bind the server to replace ens4 with the name of your network interface interface_name ens4 get the index of the network interface interface_index socket if_nametoindex interface_name bind the socket to the specified network interface server_socket setsockopt socket sol_socket socket so_bindtodevice interface_name encode bind the socket to an address and port replace forwarding_rule_vip with the actual vip virtual ip address server_address forwarding_rule_vip 80 0 0 server_socket bind server_address start listening for incoming connections the argument 5 specifies the maximum number of queued connections server_socket listen 5 print a message indicating that the server is ready to accept connections print f server listening on server_address bound to interface_name serve incoming connections while true client_socket client_address server_socket accept print f accepted connection from client_address generate response body body f thank you for connecting to vm_hostname n construct a proper http 1 1 response response http 1 1 200 ok r n f content length len body r n content type text plain r n connection close r n r n f body send the response and close the connection client_socket sendall response encode client_socket close eof make the python script executable chmod x server py run the server sudo python3 server py add the metadata file to the vm instance gcloud compute instances add metadata vm name metadata from file startup script startup sh reboot the instance test your load balancer to test the load balancer create a client vm in the same region as the load balancer and then send traffic from the client to the load balancer create a client vm this example creates a client vm vm client in the same region as the backend server vms the client is used to validate the load balancer s configuration and demonstrate expected behavior as described in the testing section console in the google cloud console go to the vm instances page go to vm instances click create instance for name enter vm client for region select us west1 for zone select us west1 a click advanced options click networking and configure the following fields for network tags enter allow ssh for network interfaces select the following network lb network ipv6 only subnet lb subnet ipv6 only ip stack type ipv6 single stack click done click create gcloud the client vm can be in any zone in the same region as the load balancer and it can use any subnet in that region in this example the client is in the us west1 a zone and it uses the same subnet as the backend vms gcloud beta compute instances create vm client zone us west1 a image family debian 12 image project debian cloud stack type ipv6_only tags allow ssh subnet lb subnet ipv6 only test the connection this test contacts the load balancer from a separate client vm that is not from a backend vm of the load balancer the expected behavior is for traffic to be distributed among the four backend vms connect to the client vm instance by using ssh gcloud compute ssh vm client zone us west1 a describe the ipv6 forwarding rule fr ilb ipv6 only note the ipv6_address in the description gcloud beta compute forwarding rules describe fr ilb ipv6 only region us west1 from clients with ipv6 connectivity run the following command curl http ipv6_address 80 for example if the assigned ipv6 address is fd20 307 120c 2000 0 1 0 0 96 80 the command should look like curl http fd20 307 120c 2000 0 1 0 0 80 additional configuration options this section expands on the configuration example to provide alternative and additional configuration options all of the tasks are optional you can perform them in any order enable global access you can enable global access for your example internal passthrough network load balancer to make it accessible to clients in all regions the backends of your example load balancer must still be located in one region us west1 internal passthrough network load balancer with global access click to enlarge to configure global access make the following configuration changes console edit the load balancer s forwarding rule in the google cloud console go to the load balancing page go to load balancing in the name column click your internal passthrough network load balancer the example load balancer is named be ilb click frontend configuration click edit edit under global access select enable click done click update on the load balancer details page verify that the frontend configuration says regional region with global access gcloud update the example load balancer s forwarding rule fr ilb to include the allow global access flag gcloud compute forwarding rules update fr ilb region us west1 allow global access you can use the forwarding rules describe command to determine whether a forwarding rule has global access enabled for example gcloud compute forwarding rules describe fr ilb region us west1 format get name region allowglobalaccess the word true appears in the output after the name and region of the forwarding rule when global access is enabled api make a patch request to the forwardingrules patch method patch https compute googleapis com compute v1 projects project_id regions us west1 forwardingrules fr ilb allowglobalaccess true create a vm client to test global access console in the google cloud console go to the vm instances page go to vm instances click create instance set the name to vm client2 set the region to europe west1 set the zone to europe west1 b click advanced options click networking and configure the following fields for network tags enter allow ssh for network interfaces select the following network lb network subnet europe subnet click create gcloud the client vm can be in any zone in the same region as the load balancer and it can use any subnet in that region in this example the client is in the europe west1 b zone and it uses the same subnet as the backend vms gcloud compute instances create vm client2 zone europe west1 b image family debian 12 image project debian cloud tags allow ssh subnet europe subnet api make a post request to the instances insert method post https compute googleapis com compute v1 projects project_id zones europe west1 b instances name vm client2 tags items allow ssh machinetype https www googleapis com compute v1 projects project_id zones europe west1 b machinetypes e2 standard 2 canipforward false networkinterfaces network https www googleapis com compute v1 projects project_id global networks lb network subnetwork https www googleapis com compute v1 projects project_id regions europe west1 subnetworks europe subnet accessconfigs type one_to_one_nat name external nat networktier premium disks type persistent boot true mode read_write autodelete true devicename vm client2 initializeparams sourceimage projects debian cloud global images debian image name disktype projects project_id zones europe west1 b disktypes pd standard disksizegb 10 scheduling preemptible false deletionprotection false connect to the vm client and test connectivity to test the connectivity run the following command gcloud compute ssh vm client2 zone europe west1 b test connecting to the load balancer on all configured ports as you did from the vm client in the us west1 region test http connectivity on the four ports configured on the forwarding rule curl http 10 1 2 99 curl http 10 1 2 99 8008 curl http 10 1 2 99 8080 curl http 10 1 2 99 8088 configure managed instance groups the example configuration created two unmanaged instance groups you can instead use managed instance groups including zonal and regional managed instance groups as backends for internal passthrough network load balancers managed instance groups require that you create an instance template this procedure demonstrates how to replace the two zonal unmanaged instance groups from the example with a single regional managed instance group a regional managed instance group automatically creates vms in multiple zones of the region making it simpler to distribute production traffic among zones managed instance groups also support autoscaling and autohealing if you use autoscaling with internal passthrough network load balancers you cannot scale based on load balancing this procedure shows you how to modify the backend service for the example internal passthrough network load balancer so that it uses a regional managed instance group console instance template in the google cloud console go to the vm instance templates page go to vm instance templates click create instance template set the name to temp...
|