Skip to content

Instantly share code, notes, and snippets.

@jinnabaalu
Last active January 9, 2018 10:52
Show Gist options
  • Save jinnabaalu/280e7eeb98a57b9573482c3044899874 to your computer and use it in GitHub Desktop.
Save jinnabaalu/280e7eeb98a57b9573482c3044899874 to your computer and use it in GitHub Desktop.

VPC in AWS

  • AWS Virtual Private Cloud (VPC) : user defined vertual network

  • Public and Private Subnets : Subnets we can define into private and public t expose to the external or internet

  • Route Tables - Main and Custom to map to the public internet gate way

  • Internet Gateway - to associate the the any route table to the internet

  • NAT Gateway - farward proxy for private subnet to connect to teh internet.

CIDR

CIDR : 10.0.0.1/26 :

2 ^ (32-26) Ip address range

i.e., 2^6 = 64

So the Ip address are from 10.0.0.0 - 10.0.0.63

Creating VPC with the CIDR range from 10.0.0.0 - 10.0.0.63

Create a subnet-1 with CDIR : 10.0.0.0/28 => 10.0.0.0 - 10.0.0.15

Create a subnet-2 with CDIR : 10.0.0.16/28 => 10.0.0.16 - 10.0.0.31

Create a subnet-3 with CDIR : 10.0.0.32/28 => 10.0.0.32 - 10.0.0.47

Create a subnet-4 with CDIR : 10.0.0.48/28 => 10.0.0.48 - 10.0.0.63

Copy file from local machine to AWS EC2

To use scp with a key pair use the following command:

scp -i path/to/key file/to/copy [email protected]:path/to/file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment