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):
o the vpc networks page go to vpc networks click create vpc network for name enter lb network ipv6 only if you want to configure internal ipv6 address ranges on subnets in this network complete these steps for private ipv6 address settings select configure a ula internal ipv6 range for this vpc network for allocate internal ipv6 range select automatically or manually if you select manually enter a 48 range from within the fd20 20 range if the range is already in use you are prompted to provide a different range for subnet creation mode select custom in the new subnet section specify the following configuration parameters for a subnet name lb subnet ipv6 only region us west1 ip stack type ipv6 single stack ipv6 access type internal click done click create gcloud to create a new custom mode vpc network run the gcloud compute networks create command to configure internal ipv6 ranges on any subnets in this network use the enable ula internal ipv6 flag gcloud compute networks create lb network ipv6 only subnet mode custom enable ula internal ipv6 bgp routing mode regional configure a subnet with the ipv6 access type set to internal this indicates that the vms in this subnet can only have internal ipv6 addresses to create the subnet run the gcloud compute networks subnets create command gcloud compute networks subnets create lb subnet ipv6 only network lb network ipv6 only region us west1 stack type ipv6_only ipv6 access type internal configure firewall rules this example uses the following firewall rules fw allow lb access ipv6 only an ingress rule applicable to all targets in the vpc network that allows traffic from all ipv6 sources fw allow ssh an ingress rule applicable to the instances being load balanced that allows incoming ssh connectivity on tcp port 22 from any address you can choose a more restrictive source ip range for this rule for example you can specify just the ip ranges of the system from which you initiate ssh sessions this example uses the target tag allow ssh to identify the vms to which it must apply fw allow health check ipv6 only an ingress rule applicable to the instances being load balanced that allows traffic from the google cloud health check probe ranges this example uses the target tag allow health check ipv6 to identify the instances to which it must apply without these firewall rules the default deny ingress rule blocks incoming traffic to the backend instances note you must create a firewall rule to allow health checks from the ip ranges of google cloud probe systems for more information see probe ip ranges and firewall rules console in the google cloud console go to the firewall policies page go to firewall policies to allow ipv6 subnet traffic click create firewall rule again and enter the following information name fw allow lb access ipv6 only network lb network ipv6 only priority 1000 direction of traffic ingress action on match allow targets all instances in the network source filter ipv6 ranges source ipv6 ranges 0 protocols and ports allow all click create to allow incoming ssh connections click create firewall rule again and enter the following information name fw allow ssh network lb network ipv6 only priority 1000 direction of traffic ingress action on match allow targets specified target tags target tags allow ssh source filter ipv4 ranges source ipv4 ranges 0 0 0 0 0 protocols and ports select specified protocols and ports select the tcp checkbox and then enter 22 in ports click create to allow google cloud ipv6 health checks click create firewall rule again and enter the following information name fw allow health check ipv6 only network lb network ipv6 only priority 1000 direction of traffic ingress action on match allow targets specified target tags target tags allow health check ipv6 source filter ipv6 ranges source ipv6 ranges 2600 2d00 1 b029 64 protocols and ports allow all click create gcloud create the fw allow lb access ipv6 only firewall rule to allow ipv6 traffic to all vm instances in the vpc network gcloud compute firewall rules create fw allow lb access ipv6 only network lb network ipv6 only action allow direction ingress source ranges 0 rules all create the fw allow ssh firewall rule to allow ssh connectivity to vms with the network tag allow ssh when you omit source ranges google cloud interprets the rule to mean any source gcloud compute firewall rules create fw allow ssh network lb network ipv6 only action allow direction ingress target tags allow ssh rules tcp 22 create the fw allow health check ipv6 rule to allow google cloud ipv6 health checks gcloud compute firewall rules create fw allow health check ipv6 only network lb network ipv6 only action allow direction ingress target tags allow health check ipv6 source ranges 2600 2d00 1 b029 64 rules tcp udp create backend vms and instance groups this example uses two unmanaged instance groups each having two backend vms to demonstrate the regional nature of internal passthrough network load balancers the two instance groups are placed in separate zones us west1 a and us west1 c instance group ig a contains these two vms vm a1 vm a2 instance group ig c contains these two vms vm c1 vm c2 traffic to all four of the backend vms is load balanced console create backend vms in the google cloud console go to the vm instances page go to vm instances repeat these steps for each vm using the following name and zone combinations name vm a1 zone us west1 a name vm a2 zone us west1 a name vm c1 zone us west1 c name vm c2 zone us west1 c click create instance set the name as indicated in step 2 for region select us west1 and choose a zone as indicated in step 2 in the boot disk section ensure that debian gnu linux 12 bookworm is selected for the boot disk options if necessary click change to change the image click advanced options click networking and configure the following fields for network tags enter allow ssh and allow health check ipv6 for network interfaces select the following network lb network ipv6 only subnet lb subnet ipv6 only ip stack type ipv6 single stack primary internal ipv6 address ephemeral automatic click create the backend vm needs to run an ipv6 tcp server that listens for incoming connections you install this server on the backend vms after you have configured the load balancer this is because the server script creates a socket that binds to the forwarding rule of the load balancer 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 ipv6 only for subnetwork select lb subnet ipv6 only 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 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 beta 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 ipv6 only stack type ipv6_only the backend vm needs to run an ipv6 tcp server that listens for incoming connections you install this server on the backend vms after you have configured the load balancer this is because the server script creates a socket that binds to the forwarding rule of the load balancer create the two unmanaged instance groups in each zone gcloud beta compute instance groups unmanaged create ig a zone us west1 a gcloud beta compute instance groups unmanaged create ig c zone us west1 c add the vms to the appropriate instance groups gcloud beta compute instance groups unmanaged add instances ig a zone us west1 a instances vm a1 vm a2 gcloud beta compute instance groups unmanaged add instances ig c zone us west1 c instances vm c1 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 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 ilb ipv6 only region us west1 network lb network ipv6 only backend configuration click backend configuration in the health check list click create a health check and then 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 ipv6 single 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 only to handle ipv6 traffic do the following for ip version select ipv6 the ipv6 tcp server that you are going to create in the following section binds to the vip of the forwarding rule for subnetwork select lb subnet ipv6 only 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 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 beta compute health checks create http hc http 80 region us west1 port 80 create the backend service gcloud beta compute backend services create ilb ipv6 only 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 beta compute backend services add backend ilb ipv6 only region us west1 instance group ig a instance group zone us west1 a gcloud beta compute backend services add backend ilb ipv6 only region us west1 instance group ig c instance group zone us west1 c create the ipv6 forwarding rule with an ephemeral ipv6 address gcloud beta compute forwarding rules create fr ilb ipv6 only region us west1 load balancing scheme internal subnet lb subnet ipv6 only ip protocol tcp ports 80 8008 8080 8088 backend service ilb ipv6 only backend service region us west1 ip version ipv6 the ipv6 tcp server that you are going to create in the following section binds to the vip of the forwarding rule install an ipv6 tcp server on the backend vms using a startup bash script in this example the bash startup script for backend vms contains the following networking commands to route all outgoing packets originating from a subnet through a specified gateway and network interface python server script server py which is an ipv6 tcp server that listens for incoming connections on the specified vip and network interface it accepts incoming client connections sends a response and then closes the connection you need to add the following details in the bash script gateway address subnet range vip of the forwarding rule network interface you can identify the gateway address and the subnet range by running the ip 6 route show table all command in the backend vm to learn more about the commands that are used in the startup bash script see the appendix section to add a startup script to the vm instance do the following note you need to run these steps for each backend vm that you created earlier console in the list of vm instances that you created earlier click the vm instance 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 ...
|