Virtual Private Cloud (VPC) Flashcards
What does CIDR stand for?
Classless Inter-Domain Routing
a method for allocating IP addresses
CIDR - Classless Inter-Domain Routing
A CIDR consists of two components
Base IP
Subnet Mask
- Represents an IP contained in the range (XX.XX.XX.XX)
- Example:10.0.0.0,192.168.0.0,…
Base IP
- Defines how many bits can change in the IP
- Example:/0,/24,/32
- Can take two forms:
- /8ó255.0.0.0
- /16ó255.255.0.0
- /24ó255.255.255.0
- /32ó255.255.255.255
Subnet Mask
basically allows part of the underlying IP to get additional next values from the base IP
CIDR - The Subnet Mask
New EC2 instances are launched into the default VPC if no ______ is specified
subnet
Default VPC has Internet connectivity and all EC2 instances inside it have public ________ addresses
IPv4
Default VPC in new EC2 instances, we also get a public and a private ____________ names
IPv4 DNS
Can you have multiple VPCs in an AWS region?
YES (max. 5 per region – soft limit)
Max. CIDR per VPC is ______ , for each CIDR:
* Min. size is
* Max. size is
5
/28 (16 IP addresses)
/16 (65536 IP addresses)
Because VPC is private, only the ________ ranges are allowed:
* 10.0.0.0 – 10.255.255.255 (10.0.0.0/8)
* 172.16.0.0 – 172.31.255.255 (172.16.0.0/12)
* 192.168.0.0 – 192.168.255.255 (192.168.0.0/16)
Private IPv4
Your VPC CIDR should ________ overlap with your other networks
NOT
AWS reserves ______ IP addresses (first 4 & last 1) in each subnet
5
These 5 IP addresses are __________ for use and can’t be assigned to an EC2 instance
not available
What does IGW stand for??
Internet Gateway
- Allows resources (e.g., EC2 instances) in a VPC connect to the Internet
- It scales horizontally and is highly available and redundant
- Must be created separately from a VPC
- OneVPC can only be attached to one IGW and vice versa
Internet Gateway (IGW)
Internet Gateways on their own __________ allow Internet access
do not
We can use a ________ to SSH into our private EC2 instances
Bastion Host
The bastion is in the _______ which is then connected to all other ___________
public subnet
private subnets
Bastion Host security group must allow inbound from the internet on _________ from restricted CIDR, for example the public CIDR of your corporation
port 22
Security Group of the EC2 Instances must allow the Security Group of the Bastion Host, or the __________ of the Bastion host
private IP
What does NAT stand for?
Network Address Translation
- Allows EC2 instances in private subnets to
connect to the Internet - Must be launched in a public subnet
- Must disable EC2 setting: Source / destination Check
- Must have Elastic IP attached to it
- RouteTables must be configured to route traffic from private subnets to the NAT Instance
NAT Instance
- AWS-managed NAT, higher bandwidth, high availability, no administration
- Pay per hour for usage and bandwidth
- NATGW is created in a specific Availability Zone, uses an Elastic IP
- Can’t be used by EC2 instance in the same subnet (only from other subnets)
- Requires an IGW (Private Subnet => NATGW => IGW)
- 5 Gbps of bandwidth with automatic scaling up to 45 Gbps
- No Security Groups to manage / required
NAT Gateway
NAT Gateway is resilient within a ___________
single Availability Zone
NAT Gateway with High Availability - Must create __________ in multiple AZs for fault-tolerance
multiple NAT Gateways
There is no cross-AZ failover needed because if an AZ goes down it _______
doesn’t need NAT
Availability
Highly available within AZ (create in another AZ)
NAT Gateway
Bandwidth
Up to 45 Gbps
NAT Gateway
Maintenance
Managed by AWS
NAT Gateway
Cost
Per hour & amount of data transferred
NAT Gateway
Availability
Use a script to manage failover between instances
NAT Instance
Bandwidth
Depends on EC2 instance type
NAT Instance
Maintenance
Managed by you (e.g., software, OS patches, …)
NAT Instance
Cost
Per hour, EC2 instance type and size, + network $
NAT Instance
Public IPv4 - Yes
NAT Gateway
Public IPv4 - Yes
NAT Instance
Private IPv4 - Yes
Nat Gateway
Private IPv4 - Yes
Nat Instance
Security Group - No
Nat Gateway
Security Group - Yes
Nat Instance
Use as Bastion Host - No
Nat Gateway
Use as Bastion Host - Yes
Nat Instance
What does NACL stand for?
Network Access Control List
are like a firewall which control traffic from and to subnets
Network Access Control List (NACL)
One NACL per ________, new subnets are assigned the ________
subnet
Default NACL
- Rules have a number (1-32766), higher precedence with a lower number
- First rule match will drive the decision
- Example: if you define #100 ALLOW 10.0.0.10/32 and #200 DENY 10.0.0.10/32, the IP address will be allowed because 100 has a higher precedence over 200
- The last rule is an asterisk (*) and denies a request in case of no rule match
- AWS recommends adding rules by increment of 100
NACL Rules
Newly created NACLs will ________ everything
deny
NACL are a great way of __________?
blocking a specific IP address at the subnet level
Accepts everything inbound/outbound with the subnets it’s associated with
Default NACL
Instead of modifying the default NACL, instead you want to _______?
create custom NACLs
- For any two endpoints to establish a connection, they must use ports
- Clients connect to a defined port, and expect a response on ________
- Different Operating Systems use different port ranges, examples:
- IANA&MSWindows10è49152–65535
- Many Linux Kernelsè32768 – 60999
Ephemeral Ports
Security Group vs. NACLs
Operates at the instance level
Security Group
Security Group vs. NACLs
Supports allow rules only
Security Group