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):
rt_conf cat file_ports prt_conf_2 echo prt_conf sed s listen 80 http_listen_prts prt_conf echo prt_conf_2 sed s listen 443 https_listen_prts echo prt_conf tee file_ports http_site_conf cat file_http_site http_site_conf_2 echo http_site_conf sed s 80 http_vh_prts echo http_site_conf_2 tee file_http_site https_site_conf cat file_https_site https_site_conf_2 echo https_site_conf sed s _default_ 443 https_vh_prts echo https_site_conf_2 tee file_https_site systemctl restart apache2 touch etc startup_script_completed click create create instance groups in the google cloud console go to the instance groups page go to instance groups repeat the following steps to create two unmanaged instance groups each with two vms in them using these combinations instance group name ig a zone us west1 a vms vm a1 and vm a2 instance group name ig c zone us west1 c vms vm c1 and vm c2 click create instance group click new unmanaged instance group set name as indicated in step 2 in the location section select us west1 for the region and then choose a zone as indicated in step 2 for network select lb network dual stack for subnetwork select lb subnet in the vm instances section add the vms as indicated in step 2 click create gcloud to create the four vms run the gcloud compute instances create command four times using these four combinations for vm name and zone the script contents are identical for all four vms vm name vm a1 zone us west1 a vm name vm a2 zone us west1 a vm name vm c1 zone us west1 c vm name vm c2 zone us west1 c gcloud compute instances create vm name zone zone image family debian 12 image project debian cloud tags allow ssh allow health check ipv6 subnet lb subnet stack type ipv4_ipv6 metadata startup script bin bash if f etc startup_script_completed then exit 0 fi apt get update apt get install apache2 y a2ensite default ssl a2enmod ssl file_ports etc apache2 ports conf file_http_site etc apache2 sites available 000 default conf file_https_site etc apache2 sites available default ssl conf http_listen_prts listen 80 nlisten 8008 nlisten 8080 nlisten 8088 http_vh_prts 80 8008 8080 8088 https_listen_prts listen 443 nlisten 8443 https_vh_prts 443 8443 vm_hostname curl h metadata flavor google http metadata google internal computemetadata v1 instance name echo page served from vm_hostname tee var www html index html prt_conf cat file_ports prt_conf_2 echo prt_conf sed s listen 80 http_listen_prts prt_conf echo prt_conf_2 sed s listen 443 https_listen_prts echo prt_conf tee file_ports http_site_conf cat file_http_site http_site_conf_2 echo http_site_conf sed s 80 http_vh_prts echo http_site_conf_2 tee file_http_site https_site_conf cat file_https_site https_site_conf_2 echo https_site_conf sed s _default_ 443 https_vh_prts echo https_site_conf_2 tee file_https_site systemctl restart apache2 touch etc startup_script_completed create the two unmanaged instance groups in each zone gcloud compute instance groups unmanaged create ig a zone us west1 a gcloud compute instance groups unmanaged create ig c zone us west1 c add the vms to the appropriate instance groups gcloud compute instance groups unmanaged add instances ig a zone us west1 a instances vm a1 vm a2 gcloud compute instance groups unmanaged add instances ig c zone us west1 c instances vm c1 vm c2 api for the four vms use the following vm names and zones vm name vm a1 zone us west1 a vm name vm a2 zone us west1 a vm name vm c1 zone us west1 c vm name vm c2 zone us west1 c you can get the current debian_image_name by running the following gcloud command gcloud compute images list filter family debian 12 create four backend vms by making four post requests to the instances insert method post https compute googleapis com compute v1 projects project_id zones zone instances name vm name tags items allow health check ipv6 allow ssh machinetype https www googleapis com compute v1 projects project_id zones zone machinetypes e2 standard 2 canipforward false networkinterfaces stacktype ipv4_ipv6 network https www googleapis com compute v1 projects project_id global networks lb network dual stack subnetwork https www googleapis com compute v1 projects project_id regions us west1 subnetworks lb subnet accessconfigs type one_to_one_nat name external nat networktier premium disks type persistent boot true mode read_write autodelete true devicename vm name initializeparams sourceimage projects debian cloud global images debian image name disktype projects project_id zones zone disktypes pd standard disksizegb 10 metadata items key startup script value bin bash napt get update napt get install apache2 y na2ensite default ssl na2enmod ssl nfile_ports etc apache2 ports conf nfile_http_site etc apache2 sites available 000 default conf nfile_https_site etc apache2 sites available default ssl conf nhttp_listen_prts listen 80 nlisten 8008 nlisten 8080 nlisten 8088 nhttp_vh_prts 80 8008 8080 8088 nhttps_listen_prts listen 443 nlisten 8443 nhttps_vh_prts 443 8443 nvm_hostname curl h metadata flavor google nhttp 169 254 169 254 computemetadata v1 instance name necho page served from vm_hostname ntee var www html index html nprt_conf cat file_ports nprt_conf_2 echo prt_conf sed s listen 80 http_listen_prts nprt_conf echo prt_conf_2 sed s listen 443 https_listen_prts necho prt_conf tee file_ports nhttp_site_conf cat file_http_site nhttp_site_conf_2 echo http_site_conf sed s 80 http_vh_prts necho http_site_conf_2 tee file_http_site nhttps_site_conf cat file_https_site nhttps_site_conf_2 echo https_site_conf sed s _default_ 443 https_vh_prts necho https_site_conf_2 tee file_https_site nsystemctl restart apache2 scheduling preemptible false deletionprotection false create two instance groups by making a post request to the instancegroups insert method post https compute googleapis com compute v1 projects project_id zones us west1 a instancegroups name ig a network https www googleapis com compute v1 projects project_id global networks lb network dual stack subnetwork https www googleapis com compute v1 projects project_id regions us west1 subnetworks lb subnet post https compute googleapis com compute v1 projects project_id zones us west1 c instancegroups name ig c network https www googleapis com compute v1 projects project_id global networks lb network dual stack subnetwork https www googleapis com compute v1 projects project_id regions us west1 subnetworks lb subnet add instances to each instance group by making a post request to the instancegroups addinstances method post https compute googleapis com compute v1 projects project_id zones us west1 a instancegroups ig a addinstances instances instance https www googleapis com compute v1 projects project_id zones us west1 a instances vm a1 instance https www googleapis com compute v1 projects project_id zones us west1 a instances vm a2 post https compute googleapis com compute v1 projects project_id zones us west1 c instancegroups ig c addinstances instances instance https www googleapis com compute v1 projects project_id zones us west1 c instances vm c1 instance https www googleapis com compute v1 projects project_id zones us west1 c instances vm c2 configure load balancer components these steps configure all of the internal passthrough network load balancer components starting with the health check and backend service and then the frontend components health check in this example you use an http health check that checks for an http 200 ok status code for more information see health checks section of the internal passthrough network load balancer overview backend service because you need to pass http traffic through the internal load balancer you need to use tcp not udp forwarding rule this example creates two internal forwarding rules for ipv4 and ipv6 traffic internal ip address in this example you specify an internal ip address 10 1 2 99 when you create the ipv4 forwarding rule for more information see internal ip address although you choose which ipv4 address is configured the ipv6 address is assigned automatically console start your configuration in the google cloud console go to the load balancing page go to load balancing click create load balancer for type of load balancer select network load balancer tcp udp ssl and click next for proxy or passthrough select passthrough load balancer and click next for public facing or internal select internal and click next click configure basic configuration on the create internal passthrough network load balancer page enter the following information load balancer name be ilb region us west1 network lb network dual stack backend configuration click backend configuration in the health check list click create a health check and enter the following information name hc http 80 scope regional protocol http port 80 proxy protocol none request click create in the new backend section for ip stack type select the ipv4 and ipv6 dual stack option in instance group select the ig a instance group and click done click add a backend and repeat the step to add the ig c instance group verify that a blue check mark appears next to backend configuration frontend configuration click frontend configuration in the new frontend ip and port section do the following for name enter fr ilb ipv6 to handle ipv6 traffic do the following for ip version select ipv6 for subnetwork select lb subnet the ipv6 address range in the forwarding rule is always ephemeral for ports select multiple and then in the port number field enter 80 8008 8080 8088 click done to handle ipv4 traffic do the following click add frontend ip and port for name enter fr ilb for subnetwork select lb subnet in the internal ip purpose section from the ip address list select create ip address enter the following information and then click reserve name ip ilb ip version ipv4 static ip address let me choose custom ip address 10 1 2 99 for ports select multiple and then in port numbers enter 80 8008 8080 and 8088 click done verify that there is a blue check mark next to frontend configuration before continuing review the configuration click review and finalize check all your settings if the settings are correct click create it takes a few minutes for the internal passthrough network load balancer to be created gcloud create a new regional http health check to test http connectivity to the vms on port 80 gcloud compute health checks create http hc http 80 region us west1 port 80 create the backend service for http traffic gcloud compute backend services create be ilb load balancing scheme internal protocol tcp region us west1 health checks hc http 80 health checks region us west1 add the two instance groups to the backend service gcloud compute backend services add backend be ilb region us west1 instance group ig a instance group zone us west1 a gcloud compute backend services add backend be ilb region us west1 instance group ig c instance group zone us west1 c create two forwarding rules for the backend service when you create the ipv4 forwarding rule specify 10 1 2 99 for the internal ip address in the subnet for ipv4 addresses gcloud compute forwarding rules create fr ilb region us west1 load balancing scheme internal subnet lb subnet address 10 1 2 99 ip protocol tcp ports 80 8008 8080 8088 backend service be ilb backend service region us west1 gcloud compute forwarding rules create fr ilb ipv6 region us west1 load balancing scheme internal subnet lb subnet ip protocol tcp ports 80 8008 8080 8088 backend service be ilb backend service region us west1 ip version ipv6 api create the health check by making a post request to the regionhealthchecks insert method post https compute googleapis com compute v1 projects project_id regions us west1 regionhealthchecks name hc http 80 type http httphealthcheck port 80 create the regional backend service by making a post request to the regionbackendservices insert method post https compute googleapis com compute v1 projects project_id regions us west1 backendservices name be ilb backends group https www googleapis com compute v1 projects project_id zones us west1 a instancegroups ig a balancingmode connection group https www googleapis com compute v1 projects project_id zones us west1 c instancegroups ig c balancingmode connection healthchecks https www googleapis com compute v1 projects project_id regions us west1 healthchecks hc http 80 loadbalancingscheme internal connectiondraining drainingtimeoutsec 0 create the forwarding rule by making a post request to the forwardingrules insert method post https compute googleapis com compute v1 projects project_id regions us west1 forwardingrules name fr ilb ipv6 ipprotocol tcp ports 80 8008 8080 8088 loadbalancingscheme internal subnetwork https www googleapis com compute v1 projects project_id regions us west1 subnetworks lb subnet backendservice https www googleapis com compute v1 projects project_id regions us west1 backendservices be ilb ipversion ipv6 networktier premium create the forwarding rule by making a post request to the forwardingrules insert method post https compute googleapis com compute v1 projects project_id regions us west1 forwardingrules name fr ilb ipaddress 10 1 2 99 ipprotocol tcp ports 80 8008 8080 8088 loadbalancingscheme internal subnetwork https www googleapis com compute v1 projects project_id regions us west1 subnetworks lb subnet backendservice https www googleapis com compute v1 projects project_id regions us west1 backendservices be ilb networktier premium 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 dual stack subnet lb subnet ip stack type ipv4 and ipv6 dual stack primary internal ip ephemeral automatic external ip ephemeral 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 compute instances create vm client zone us west1 a image family debian 12 image project debian cloud stack type ipv4_ipv6 tags allow ssh subnet lb subnet api make a post request to the instances insert method post https compute googleapis com compute v1 projects project_id zones us west1 a instances name vm client tags items allow ssh machinetype https www googleapis com compute...
|