AWS Networking Workshop – Part 1
Enabling DNS Names in VPC
- Create a VPC with atleast one public subnet.
- Create an ec2 instance in public subnet, ensure the security group rule is open for 22 and 80
- By default in vpc the Public DNS Names are not enabled

- To enable public DNS names



DHCP Options Set
- DHCP Options set is used to set the DNS Servers in VPC

Create an ec2 instance with some predefined private ip.
- Create a Network interface in the subnet (zone) where your ec2 instance is running.
- Choose Custom for private ip address.
- Attach this network interface to your ec2 instance




Lab Prep
- Create an ec2 instance and ensure you execute the following steps
sudo apt update
sudo apt install apache2 stress -y
sudo apt install php libapache2-mod-php php-mysql -y
sudo -i
echo "<?php phpinfo(); ?>" > /var/www/html/info.php
- Navigate to
http://publicip/info.php
- Create an AMI




- Wait till the AMI creation is completed
- Delete the ec2 instance
Load Balancing
OSI Model of Networking
- Layers

- Layers & Protocols

Layer 4 and Layer 7 LoadBalancing
- Load Balancing can be done at Layer 4 and Layer 7
- Layer 4:
- Aware: IP, Port, TCP/UDP, MAC
- Layer 7:
- Aware: IP, Port, TCP/UDP, MAC, HTTP, SSL/TLS (security)
Load Balancers in AWS
- In AWS we have following load balancers
- AWS classic Load Balancer:
- Both L4 and L7 loadbalancing
- AWS Network Load Balancer:
- AWS Application Load Balancer
Layer 4 load balancing
- Create a VPC with two subnets in two different zones
- Create an ec2 instance in subnet 1 and subnet2
- Ensure 80 and 22 ports are opened in securty group for all.

- Create a Layer 4 load balancer using Network Load Balancer
















- Now access by using `http:///info.php

Layer 7 loadbalancing
- AWS has Application Load Balancer which can perform layer 7 load balancing

- login into web1 and execute the following
# web1
# root
mkdir -p /var/www/html/images
echo "<h1>images</h1>" > /var/www/html/images/index.html
- access the application by using
http://publicip/images/index.html
- login into web2 and execute the following
# web2
# root
mkdir -p /var/www/html/music
echo "<h1>music</h1>" > /var/www/html/music/index.html
- access the application by using
http://publicip/music/index.html
- http health checks:
- Status Codes

- Interval: how frequently load balancer will perform health checks?
- Healthy threshold: How many consecutive health checks should be passed to consider the instance healthy
- UnHeathy threshold: How many consecutive health checks should be failed to consider the instance unhealthy
- Target Group for every application component running independently i.e. we will be creating two target groups images and music
- Lets create a Application Load Balancer




- Select the default target group for now

- Complete the creation
- Path Based Routing: Refer Here
- Now lets manage rules in listener



Aws Options Load Balancing in Single Region
- Layer 4 Load Balancing using Network load balancer
- Layer 7 load balancing uing ALB using path based Routing
Lab Setup for Next Set of Activities
- We have AMI in a Region, lets copy that to other region


- Create a vpc with two public subnets and create web1 and web2 in the other region as well
Like this:
Like Loading...