VPC Continued
-
Lets create the following network
-
Create a VPC and then create security group to open ssh and http from any where
- Now lets create an ec2 instance with public ip in the web1 subnet
- AWS VPC by default will not be connected to or from internet. If you need an internet access, we need to create an Internet gateway and attach it to our vpc
- Now lets create a Route in the Default Route table to forward the packets to internet gateway
- AWS by default enables the Route to connect all subnets/instances within vpc
- For internet, we need to create a route in the route table
- Now connect to ec2 using ssh
- Now check whether ec2 instance can access internet
- Lets install apache server
sudo yum install httpd -y
sudo systemctl enable httpd
sudo systemctl start httpd