{"id":11102,"date":"2022-07-05T18:16:20","date_gmt":"2022-07-05T12:46:20","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/?p=11102"},"modified":"2022-07-05T18:27:12","modified_gmt":"2022-07-05T12:57:12","slug":"learn-the-hacks-of-internal-load-balancing-in-aws-through-cross-region-vpc-peering","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/learn-the-hacks-of-internal-load-balancing-in-aws-through-cross-region-vpc-peering\/","title":{"rendered":"Cross Region Internal Load Balancing\u00a0 in AWS with VPC Peering"},"content":{"rendered":"\n<p class=\"has-text-align-justify wp-block-paragraph\">Load Balancing is a method of addressing High Availability in any Cloud deployment. Load Balancers note the health of backend resources, thereby not sending traffic to servers that are not able to fulfill requests. The main aim of load balancing is to prevent any single server from getting overloaded and possibly breaking down.<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">In this blog, we are talking about internal load balancing with Network Load Balancer and Application Load Balancer. Network Load Balancer automatically provides a static IP per Availability Zone (subnet) to be used by applications as the front-end IP of the Load Balancer.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">The idea of writing this blog came from a task  that I got which is as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li> Put 2 servers in private subnets in one region(N. Virginia) and one server in a private subnet of&nbsp; another region(Oregon)<\/li><li>Use network load balancer and keep it internal and put these&nbsp; 3 servers in the target group of the load balancer<\/li><li>Check internal load balancer  is working or not<\/li><\/ul>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">However, AWS does not support cross-region load balancing in AWS. I fixed it with cross-region VPC peering and then went with target type IP addresses in the load balancer target group. Lastly, I added steps for internal load balancing with the application load balancer as well.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Setup Overview:<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">2 VPC: 1 in N.Virginia and 1 in Oregon<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2 public Subnet: one in each VPC<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">3 private Subnet: 2 in N.Virginia and 1 in Oregon<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3 Ec2 instances: 1 in each private Subnet<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">1 network load balancer : In N.Virginia region&nbsp;<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>The following steps were performed in the N.Virginia region :<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-1<\/strong>: Create a vpc (VPC-NV) in N.Virginia region with <strong>10.0.0.0\/26<\/strong> CIDR<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-2<\/strong>: Create 3 subnets with the following CIDR in N.Virginia region<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">NV-PUB-A(<strong>10.0.0.0\/28<\/strong>)<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">NV-PRIV-A(<strong>10.0.0.16\/28<\/strong>)<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">NV-PRIV-B (<strong>10.0.0.48\/28<\/strong>)<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step -3:<\/strong> Create an internet gateway(NV-IGW) and attach it with VPC-NV<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-4:<\/strong> Create 2 route table named NV-PUB-RT and NV-PRIV-RT<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-5: <\/strong>Associate NV-PUB-A public subnet with NV-PUB-RT  route table and add NV-IGW Internet gateway with it&nbsp;which was created in step 3 <\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-6:<\/strong> Create an (NV-NAT)  Nat gateway in the public subnet and add this Nat gateway in the NV-PRIV-RT route table.<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-7: <\/strong>We can see two private subnet are associated with the NV-PRIV-RT route table and one public subnet associated with NV-PUB-RT<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2022\/07\/image-7.png?w=1024\" alt=\"\" class=\"wp-image-11138\" width=\"628\" height=\"303\" \/><figcaption>NV-PUB-RT<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2022\/07\/image-8.png?w=1024\" alt=\"\" class=\"wp-image-11139\" width=\"629\" height=\"237\" \/><figcaption>NV-PRIV-RT<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The following steps were performed in the Oregon region:<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-8:<\/strong>  Like N.Virginia, Create a VPC in the Oregon region with <strong>10.0.1.0\/26<\/strong> CIDR<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-9:<\/strong> Create one public  and one private subnet <\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">OREG-PUB-A(<strong>10.0.1.0\/28<\/strong>)<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">OREG-PRIV-A(<strong>10.0.1.32\/28<\/strong>) <\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-10:<\/strong> Create 2 route tables (OREG-PUB-RT), (OREG-PRIV-RT&nbsp;), one Internat gateway(OREG-IGW), One Nat gateway (OREG-NAT) and associate public and private subnet to the route tables <\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-11:<\/strong> Now go to N.virginia region and go for vpc and in vpc search for peering connection, Create a new peering connection<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">Name (NV-to-OREG)&#8211;&gt; Select a local VPC to peer with  (NV-VPC)&#8211;&gt;Select another VPC to peer with (my account)&#8211;&gt; Region (another region) choose region from drop down list (US West Oregon)&#8211;&gt; VPC ID (Accepter) (vpc-0414bfe109d9c3459) copy your another region VPC-ID and paste here&#8211;&gt; Create peering connection<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/Jhbd_oM_WxhUy8ykBYmh9OYt9BA9dOn9RZdy4hP08OR03Es8n5obWFR00lp8F96dOiHSLTNK2zDEGG79m5QBRX1UMuZ5Qv-mFk9W7-BcPgzUgpgAmhOWlwNvZV8zB9Hm4dD0xw_UxNgJVLQ4R6I\" alt=\"\" width=\"631\" height=\"316\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-1<\/strong>2: Go for peering connection in Oregon region, you see it is in pending acceptance state.  Now go to actions and accept it, you see how it is in the provisioning state and after refreshing, it comes into the Active state.&nbsp;<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-<\/strong>13: Go for the N.virginia region and refresh the peering connection now it should be in an active state&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/uZE8Xe7Hyv8HQgNhNGkdVcxnJt6KZC4kWDb2XvBAuEYwlKNy2m6rk55wywzPA_THq3Kmuf7Eoio2LuaiA9XN8JZh_sQoImNNE5d14EpTepeY36BMSXcqMCTkL6LNsRm1HxQ79heRxtttnWnvYZI\" alt=\"\" width=\"632\" height=\"126\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-14:  <\/strong>Now go for route table NV-PUB-RT and edit the route for peering connection, final route table look like this<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/pBRRSmtqhGOm7M99-hl9u2hIPLkMUNeelntnRuLy85H2QusMZNqmKZdvFOjaVhKBNSGp8cp6A4ikthhnDi_LrqtDeAEdHLfNLCslK3ju-IjctRD6bRKE5HZMXqD3S8fNKjxmSLrQIm3cX087zMw\" alt=\"\" width=\"631\" height=\"331\" \/><figcaption>NV-PUB-RT after adding peering connection<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-15:<\/strong> Go for Oregon region and edit OREG-PRIV-RT&nbsp;route table and add peering connection to it<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/3zQOVuXnTud2Sw2r28FYKRfxWxUUJSNc0RU_elfPwHag1PS85fF8SulMcxROhrtPDH3Jx_MxrF12U6iRtiUiJHSDnEOd_8Dp_WAa3cjDEn5kg8Oi8OOVn2-ulcZg1Mb87ANJUV1RhOvZDsbTGw8\" alt=\"\" width=\"631\" height=\"330\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Note:<\/strong> we can add Peering connection entry in NV-PUB-RT in N.Virginia and OREG-PRIV-RT in Oregon region<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-16: <\/strong>We are doing Internal load balancing so this step is important<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Go for vpc in both region and choose vpc and in actions select edit DNS hostnames(by default disable) and Enable it&nbsp;<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/RWWZQHW6ZxeEem17VMDW2fFtBa-ejP8JjsLSTXZUIdxpAtA__RpTh9qLl2ihIhs0GkGJum2HDTZUlnwv0Nqp7QCSmuR4JAOdV-EzV7yf4r2ELsLEy_IIFyr-QeysQpm1gvHfznaGEeNgB442X0M\" alt=\"\" width=\"631\" height=\"254\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-17:<\/strong> Go for EC2 services&nbsp; in N.virginia and launch 3 instances one in NV-PUB-A subnet (with public IP) and the other two in NV-PRIV-A and NV-PRIV-B subnet respectively without public IP (Keep them private instances)&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/293H5CFif8YZhP_1aQ9Chd5_V3rj7v8bGaa8WB9A3o4IxZRU-AN4fpXGZnFR-BnyZF02MuZ02dZbscHy3rzZdWNzp4gWZyAZV7Ohbs40wCgOIG0dksb0GumtWLamtOH66FINPf3z01TwqTKI6YM\" alt=\"\" width=\"633\" height=\"142\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-18: <\/strong>Go for the Oregon region and launch 2 instances, one in the public subnet (OREG-PUB-A) and one in the private subnet (OREG-PRIV-A)<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/O9-FMsMNh6ftc1S4trFbKxFOvOVZe2HLZru_lEMfccRXVBgPahui2J7eXND7iElIVzhqha5Itu2tSLc70JL38h3KBK2GTVXRT0DKLTzCpBxYDBPvlyzBo6KWh4rARlKArg3jSYGdfIAUPlRSnyA\" alt=\"\" width=\"629\" height=\"104\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-19:<\/strong> Security group (NV-SG) and (OREG-SG) attached with instances respectively<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2022\/07\/image-9.png?w=1024\" alt=\"\" class=\"wp-image-11146\" width=\"631\" height=\"330\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-20:<\/strong> Access any server with ssh(bastion) and try to telnet private IP of another region instance, if it is giving below output our cross region vpc peering works properly.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/sAzGTt9_qrK4n3DXd4QJ9lChqoAs5bHXlVUiOsZfFwVveJp73pGSObB6gaFw7gGhlsMpQXVbecJgQbbCstGm_p_WjmabBqSO9ko4-1cxz9NIJnjsMzQdp4YkAZJdjuE13793cOfrKOWcEEFc_mM\" alt=\"\" width=\"633\" height=\"133\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Before doing further steps Go for private instances (through bastion hosts) and install Nginx<\/strong> and customize the index.html default page on all three instances (two in N.virginia and one in <strong>Oregon private subnets)&nbsp;<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"667\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2022\/07\/image-10.png?w=774\" alt=\"\" class=\"wp-image-11149\" \/><figcaption>Custom HTML page <\/figcaption><\/figure>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Steps for Internal load balancing:<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-21:&nbsp;<\/strong> Go for N.virginia region and in EC2 services choose load balancing, Go for target groups and create a new target group<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">Basic configuration (IP addresses)&#8211;&gt; Target group name (NW-TG)&#8211;&gt; VPC(NV-VPC)&#8211;&gt; Next &#8211;&gt; Register targets&#8211;&gt; Choose a network (NV-VPC)&#8211;&gt; Specify IPs and define ports (paste private ip of instances launched in private subnets in NV-VPC)&#8211;&gt; Click on include as pending below &#8211;&gt; create target group<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-22:<\/strong> Go for register targets again, Choose another private IP address in the network section and paste Oregon region instance (OREG-PRIV-A) private IP and click on include as pending below and create target group<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/Ztt0NNkydmG2l65NklQya61H4dn6F5yFyrQjg7VXoYKUydirjQDuXcdFQw0kOJrkKtBbqhwaoamtU_A31fRGTIkkn3MCvGadseS9xF9b8ljYx4YP8jW-Zp2tJ-2CLerixkKZSU4Lm5jQEte2-XU\" alt=\"\" width=\"800\" height=\"362\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-23: <\/strong>These targets are in an unused state until we not associate this target group with any load balancer&nbsp;<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-24:<\/strong> Go for the load balancer and create a network load balancer&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Basic configuration&#8211;&gt; Load balancer name (NW-LB)&#8211;&gt; Scheme (Internal)<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/C7PSaJVLu8dGcwvP6SlSntGZXKMq8mqqZh2CQ5iM6p6ZwkiCCcVrKlDlIv2jYTaY7N39q9xRCq4kC3IYAkeEGa1D1drtrDEz63B6gCM2F-AbySEC6skICwWsGmVOjT-PeF7JonGeBod6vgTPB80\" alt=\"\" width=\"657\" height=\"403\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Network mapping&#8211;&gt; VPC (NV-VPC)&#8211;&gt; Mappings [ (us-east-1a), (us-east-1b)]<\/li><\/ul>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Note: <\/strong>choose both private subnets in this step. If you are making an internet-facing load balancer then choose at least one public subnet<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/uUgpaLSNdND7JUGIXWXydz_LSwIBJNb4Nh8qdJiEMn32OBfDFwtej5Vl2Ve-JWKxg0nLtwy9S1065MPyKzsbZUbAPHYmEgFB2YKUG0suy-rxmUuzFhOMikQEuURWlr-qn9jFUWMPx2LIv64_2DI\" alt=\"\" width=\"636\" height=\"433\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Listeners and routing&#8211;&gt; Choose target group (NW-TG)&#8211;&gt; Create a load balancer<\/li><\/ul>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-25:<\/strong> G o to target groups and check the health status of all instances&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/Mr0QpwE1GJhEDLBIBWnM1dzfiO-nzAJpcnysn2tFYeC83gdbsbX8FJGm6DpJ07y7kg0ouGlzp1csimFElnQYRscBQ2oNoroi9G1zUXKALk0GZIZ2ZXv3PcI88-sjs8pW5QEj234fnvkl9eDOF-g\" alt=\"\" width=\"632\" height=\"354\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-26<\/strong>: Copy load balancer DNS and check load balancer DNS resolving or not<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">nslookup &lt;DNS of network load balancer&gt;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2022\/07\/image-11.png?w=828\" alt=\"\" class=\"wp-image-11150\" width=\"810\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-27: <\/strong>Now hit the below command from any instance and check for Internal load balancing is working or not(when we are hitting with the below command, we get customized HTML page of 3 servers), I am pasting one screenshot of customized page<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">curl &lt;DNS of network load balancer&gt;<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/wO4IpSPrI5W3rTsFB1ztUlqEdyCMLJPuqq5k9P-5wJy_w4Dt9lwefWP1wvi1CUrxUy7m-HrSMTWgnsPsOeJ2jUDJuefnYzd6K9OneRIG9LUoWEbqyUH1xGlEaSdv5VE42SsiG6BoUHdvC2YLieM\" alt=\"\" width=\"631\" height=\"330\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Steps for Application load balancer:<\/strong>  Now we test our internal load balancing with an Application load balancer<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-28:<\/strong> Go to actions and delete NW-LB load balancer and Target group,&nbsp;And create a Target Group same as above and an application load balancer <\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-2<\/strong>9: All steps are the same but in the application load balancer we see security groups, we choose the same security group(NV-SG) which is for our Ec2 instances<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\"><strong>Step-30: <\/strong>After the creation of  load balancer  curl &lt;DNS &gt; from any server in N.Virginia, We get customized HTML pages <\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/Bc6hxxbLC9pPGgK92uyoI3IF0Kg8OzfRHiyAEZlaA1YQLW2om-82EwnnzCb1ZHCbZ1O6gLpT6id2uOLdXAItCcWshdvrvKwhh2xmuD03IXg3fP7cALx2yx8Nwkslj0WCfug8udzqMRu4mivpMxY\" alt=\"\" width=\"631\" height=\"330\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/tpRKrmJEeWRM4wukkwwM6BL_pAbwvIp9GEa-ksPQdsvkZJAkrq_BF_Mv8ySX3Ob8I1v0HA2IW0vf2JnWrSeYgxSF6a6OedX1oJl4DU85wMwuqFXQ8rANasYNwgH8gmMRSYeQpzC4BcUX7FDpGHw\" alt=\"\" width=\"631\" height=\"330\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Conclusion:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A cross-region load balancer ensures service is available globally across multiple AWS regions. If one region fails, the traffic is routed to the next closest healthy regional servers. But cross-region load balancing is not supported in AWS.<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">I tried searching for a solution to this scenario and  I decided to explore the possible solutions and find how to achieve this by using cross-region VPC peering and find that Network Load Balancers now support connections from clients to IP-based targets in peered VPCs across different AWS Regions.<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">I also tried it with the Application load balancer and see that it works with both load balancers.<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">The above solution will help to achieve internal load balancing using cross-region VPC peering.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Happy learning&#8230;&#8230;.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br><strong style=\"font-weight:bold;\">Blog Pundit:<\/strong> <a href=\"https:\/\/opstree.com\/blog\/\/author\/naveenverma023\/\"><strong>Naveen Verma<\/strong><\/a> and <a rel=\"noreferrer noopener\" href=\"https:\/\/opstree.com\/blog\/\/author\/sandeep7c51ad81ba\/\" target=\"_blank\"><strong>Sandeep Rawat<\/strong><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.opstree.com\/contact-us?utm_source=wordpress&amp;utm_campaign=Learn-the-hacks-of-internal-load-balancing-in-AWS-through-cross-region-VPC-peering&amp;utm_id=Blog\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Opstree<\/strong> <\/a>is an End to End DevOps solution provider<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/www.opstree.com\/contact-us\" target=\"_blank\" rel=\"noreferrer noopener\">CONTACT US<\/a><\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><strong>Connect Us <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-social-links aligncenter is-content-justification-right is-layout-flex wp-container-core-social-links-is-layout-026eaadd wp-block-social-links-is-layout-flex\"><li class=\"wp-social-link wp-social-link-linkedin wp-block-social-link\"><a href=\"https:\/\/www.linkedin.com\/company\/opstree-solutions\" class=\"wp-block-social-link-anchor\" target=\"_blank\" rel=\"noopener\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">LinkedIn<\/span><\/a><\/li>\n\n<li class=\"wp-social-link wp-social-link-youtube wp-block-social-link\"><a href=\"https:\/\/www.youtube.com\/channel\/UCeLma6SpNYH7jjYKSBNSexw\" class=\"wp-block-social-link-anchor\" target=\"_blank\" rel=\"noopener\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">YouTube<\/span><\/a><\/li>\n\n<li class=\"wp-social-link wp-social-link-github wp-block-social-link\"><a href=\"https:\/\/github.com\/OpsTree\" class=\"wp-block-social-link-anchor\" target=\"_blank\" rel=\"noopener\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">GitHub<\/span><\/a><\/li>\n\n<li class=\"wp-social-link wp-social-link-facebook wp-block-social-link\"><a href=\"https:\/\/www.facebook.com\/opstree\" class=\"wp-block-social-link-anchor\" target=\"_blank\" rel=\"noopener\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">Facebook<\/span><\/a><\/li>\n\n<li class=\"wp-social-link wp-social-link-medium wp-block-social-link\"><a href=\"https:\/\/medium.com\/buildpiper\" class=\"wp-block-social-link-anchor\" target=\"_blank\" rel=\"noopener\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M13.2,12c0,3-2.4,5.4-5.3,5.4S2.6,15,2.6,12s2.4-5.4,5.3-5.4S13.2,9,13.2,12 M19.1,12c0,2.8-1.2,5-2.7,5s-2.7-2.3-2.7-5s1.2-5,2.7-5C17.9,7,19.1,9.2,19.1,12 M21.4,12c0,2.5-0.4,4.5-0.9,4.5c-0.5,0-0.9-2-0.9-4.5s0.4-4.5,0.9-4.5C21,7.5,21.4,9.5,21.4,12\"><\/path><\/svg><span class=\"wp-block-social-link-label screen-reader-text\">Medium<\/span><\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Load Balancing is a method of addressing High Availability in any Cloud deployment. Load Balancers note the health of backend resources, thereby not sending traffic to servers that are not able to fulfill requests. The main aim of load balancing is to prevent any single server from getting overloaded and possibly breaking down. In this [&hellip;]<\/p>\n","protected":false},"author":223516673,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[28070474],"tags":[768739294,460,4843,76189810,4996032,220327261],"class_list":["post-11102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","tag-aws","tag-blogs","tag-hacks","tag-internal-load","tag-technical-blogs","tag-vpc-peering"],"blocksy_meta":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-2T4","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/11102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/223516673"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=11102"}],"version-history":[{"count":25,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/11102\/revisions"}],"predecessor-version":[{"id":11185,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/11102\/revisions\/11185"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=11102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=11102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=11102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}