AWS VPC
Route tables
- This is equivalent to router.
- In AWS When we create a vpc it will have a default route table. The default route table will route all internal communication with in a vpc.

- We can create route tables and associate them with subnets. The custom route table only can route all the internal communication.
Internet Gateway
- AWS has internet gateway which can be associated with vpc to get two way internet access
- Public ips attached to resources will work if there is internet gateway attached and a supporting route table

Tags in AWS
- In AWS almost every resource can be tagged.
- Many AWS resources dont go by names, they go by ids
- For convienience aws use Name tag
Lets create a vpc and ensure the ec2 instance with public ip is accesible
- Create a vpc (10.0.0.0/16) with 2 subnets
- subnet-1 (10.0.0.0/24)
- subnet-2 (10.0.1.0/24)

- View the default route table and change the name tag

- lets create a open all security group as security group belongs to vpc
- Lets create a ec2 instance and attach public ip address and try to connect from your system


- At this point of time our network is as shown below

- Lets try to ssh into ec2 instance.

- Lets attach internet gateway to the vpc and check the ssh again







- route and internet gateway are not connected.
- Lets change the default route table and create a route to internet gateway



-
Checking ssh access now and access to internet from ec2 instance.

-
Lets add one more ec2 instance in subnet 2 without public ip


Note
- In rules (firewalls, security groups,…) we can restrict access based on network id not host id
100.100.0.0/16
100.100.x.x
99.99.99.0/24 => 99.99.99.x
102.101.100.99/32 => 102.101.100.99
0.0.0.0/0 => x.x.x.x
Azure Virtual Network
- Azure vnet by default has internet access
- Lets create vnet in azure according to the below image





- Now create ubuntu vm in subnet 1 with public ip. This vm should be accesible from internet and also should be able to access internet.





-
Now lets create one more ubuntu vm in subnet 2 without public ip.



- How many devices can we connect in azure vnet’s subnet with cidr range 192.168.0.0/24 ?. What are the reserved ips
- How many devices can we connect in aws vpc’s subnet with cidr range 192.168.0.0/24 ? What are the reserved ips
