Networking and VPC Flashcards

1
Q

What is default VPC?

A

When you start using Amazon VPC, you have a default VPC in each AWS Region. A default VPC comes with a public subnet in each Availability Zone, an internet gateway, and settings to enable DNS resolution.

The default VPC also has the internet access

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is VPC?

A

Amazon Virtual Private Cloud (Amazon VPC) enables you to launch AWS resources into a virtual network that you’ve defined. This virtual network closely resembles a traditional network that you’d operate in your own data center, with the benefits of using the scalable infrastructure of AWS.
You can have upto 5 VPC per region (it can be changed).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If you need 29 IP addresses for EC instances in your subnet. Which CIDR range you will use?

A

You cannot use the subnet of size /27 (means 32 ipaddress). 5 IP addresses are reserved. There you will have only32-5= 27.
You should use /26, means 2 to the power 6 = 64. 64-5=59

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is Internet gateway?

A

An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet. It supports IPv4 and IPv6 traffic. It does not cause availability risks or bandwidth constraints on your network traffic.

one VPC can only be attached to one internet gateway and vice versa.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is route table?

A

Your VPC has an implicit router, and you use route tables to control where network traffic is directed. Each subnet in your VPC must be associated with a route table, which controls the routing for the subnet (subnet route table). You can explicitly associate a subnet with a particular route table. Otherwise, the subnet is implicitly associated with the main route table. A subnet can only be associated with one route table at a time, but you can associate multiple subnets with the same subnet route table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is bastion host?

A

A bastion host is a server whose purpose is to provide access to a private network from an external network, such as the Internet. Because of its exposure to potential attack, a bastion host must minimize the chances of penetration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is NAT Instance?

A

A NAT (Network Address Translation) instance is, like a bastion host, an EC2 instance that lives in your public subnet. A NAT instance, however, allows your private instances outgoing connectivity to the internet while at the same time blocking inbound traffic from the internet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is NAT gateway?

A

NAT Gateway is a highly available AWS managed service that makes it easy to connect to the Internet from instances within a private subnet in an Amazon Virtual Private Cloud (Amazon VPC). Previously, you needed to launch a NAT instance to enable NAT for instances in a private subnet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What’s the difference between NACL and security group?

A
  1. Network ACLs are applicable at the subnet level, so any instance in the subnet with an associated NACL will follow rules of NACL. That’s not the case with security groups, security groups has to be assigned explicitly to the instance.
  2. Security groups are stateful. This means any changes applied to an incoming rule will be automatically applied to the outgoing rule. e.g. If you allow an incoming port 80, the outgoing port 80 will be automatically opened.
    Network ACLs are stateless. This means any changes applied to an incoming rule will not be applied to the outgoing rule. e.g. If you allow an incoming port 80, you would also need to apply the rule for outgoing traffic.
  3. Security group supports allow rules only (by default all rules are denied). e.g. You cannot deny a certain IP address from establishing a connection.
    Network ACL supports allow and deny rules. By deny rules, you could explicitly deny a certain IP address to establish a connection example: Block IP address 123.201.57.39 from establishing a connection to an EC2 Instance.
  4. All rules in a security group are applied whereas rules are applied in their order (the rule with the lower number gets processed first) in Network ACL.
    Security groups evaluate all the rules in them before allowing a traffic whereas NACLs do it in the number order, from top to bottom.
  5. Network ACL first layer of defense, whereas Security group is second layer of the defense for inbound/ingress traffic.
    Security group first layer of defense, whereas Network ACL is second layer of the defense for outbound/egress traffic.
  6. Subnet can have only one NACL, whereas Instance can have multiple Security groups.
  7. Security group rule allow CIDR, IP, Security group as destination.
    Network ACL rule only allow CIDR as destination.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is VPC peering?

A

A VPC peering connection is a networking connection between two VPCs that enables you to route traffic between them using private IPv4 addresses or IPv6 addresses. Instances in either VPC can communicate with each other as if they are within the same network. You can create VPC peeting connection between VPC in different AWS accounts and regions.

They should not have overlapping CIDRs.
If A is connected to B, B is connected to C. A and C would not be able to communicate. A and C should have peering.

You must update route table in each VPC subnet to ensure EC2 instances can communicate with each other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is VPC Endpoint?

A

VPC endpoints are virtual devices. They are horizontally scaled, redundant, and highly available Amazon VPC components that allow communication between instances in an Amazon VPC and services without imposing availability risks or bandwidth constraints on network traffic.

The idea is that you have services on AWS, for example, such as DynamoDB and they are accessible publicly. That means that your whole infrastructure through your NAT gateway and then your internet gateway or just directly through your internet gateway does access DynamoDB. But all this traffic goes through the public internet
and you may have other services such as CloudWatch and Amazon S3 that you also wanna access without going through the internet. You wanna access them privately.
So the idea is that you’re going to use VPC endpoints so that your instances don’t have to go through the public internet, they can just go directly through the private AWS network to these services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is VPC flow logs?

A

VPC Flow Logs is a feature that enables you to capture information about the IP traffic going to and from network interfaces in your VPC. Flow log data can be published to the following locations: Amazon CloudWatch Logs, Amazon S3, or Amazon Kinesis Data Firehose.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

If you need to ping your EC2 instances from on premises, what you will need to do in your security group?

A

You will need to enable ICMP protocol on the inbound of your security group.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what are the two components of site to site VPN?

A
  1. Virtual Private Getaway (VGW): is the VPN connector on the AWS side of the VPN connection. it is created and attached to the VPC from where you to create site to site VPN connection.
  2. customer gateway (CGW): it’s a software application or physical device on customer side for the VPN connection

We have a corporate data center with a customer gateway, and then we have our VPC with our virtual private gateway. So, how do we set up the customer gateway device that is on premises? Which IP address should we use? Well, if your customer gateway is public, there is a public internet-routable IP address for your customer gateway device. Then you would use this one, and you would establish the connectivity between your VGW and your CGW using the public IP of the customer gateway.

But it’s possible for your customer gateway to also be private and have a private IP. In this case, it is very common for it to be behind a NAT device that has NAT-T enabled.
The NAT device has a public IP, and it can be used by the CGW for the connectivity.
And then, the site-to-site VPN connection can be established.

The second question that can come up to the exam is that, even though this is set up, this site-to-site VPN connection will not work until you enable route propagation in your VPC within your subnets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How many types of VPC end points are there?

A

VPC Endpoints
* Provisions an ENI (private IP address) as an entry
point (must attach a Security Group)
* Supports most AWS services
* $ per hour + $ per GB of data processed
* Interface Endpoint is preferred when access is required from onpremises (Site to Site VPN or Direct Connect), a different VPC or a different region

Gateway Endpoints
* Provisions a gateway and must be used as a target in a route table (does not use security groups)
* Supports both S3 and DynamoDB
* it’s Free

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

You have established the site to set VPN connection but it still is not working. What could be the reason?

A

The reason could be that you have not unable route propagation for the virtual private gateway in the route table that is associated with your subnet

17
Q

What is VPN CloudHub?

A
  • Provide secure communication between multiple sites, if you have multiple VPN connections
  • Low-cost hub-and-spoke model for primary or secondary network connectivity
    between different locations (VPN only)
  • It’s a VPN connection so it goes over the public Internet
  • To set it up, connect multiple VPN connections on the same VGW, setup dynamic routing and configure route tables
18
Q

How you will establish a connection with the On-prem data center doesn’t have the public data center?

A

It’s common that the data center may have A NAT device that have NAT-T enabled and has a public IP address.

19
Q

What is Direct Connect (DX)?

A

AWS Direct Connect is a network service that provides an alternative to using the Internet to utilize AWS cloud services. AWS Direct Connect enables customers to have low latency, secure and private connections to AWS for workloads which require higher speed or lower latency than the internet.

20
Q

What is Direct Connect Gateway?

A
  1. Direct Connect Gateway is a global network device that helps establish connectivity that spans multiple VPCs spread across multiple AWS Regions. It is a globally available resource that can be created in any Region and accessed from all other Regions.
  2. It supports Private VIF only and does not support Public VIF.
  3. DX Gateway and Private VIF should be in the same AWS account, whereas the connected VPCs can be in different AWS accounts and regions.
  4. It can be associated with
    * a Virtual Private Gateway in any VPC, Region, or Account
    * a Transit Gateway for multiple VPCs in the same region
21
Q

How to encrypt data on direct connect?

A

AWS Direct Connect does not encrypt your traffic that is in transit by default. To encrypt the data in transit that traverses AWS Direct Connect, you must establish a VPN between AWS direct connection location and the customer network.

22
Q

What is the cost-efficient way to have a backup of AWS Direct Connect?

A

You have your corporate data center and it’s connected to your VPC using Direct Connect. It’s your primary connection and it’s expensive. Sometime, you may have a connectivity issue with your VPC. Therefore, you can use a secondary Direct Connect, but that would be quite expensive. Alternatively, you can set up a site to site VPN connection as a backup connection. If the primary connection fails, you connect through the public internet using site to site VPN, which can be a bit more reliable because the internet, public internet, may always be accessible.

23
Q

How to achieve Direct connect - High Resiliency?

A

High Resiliency:

For critical production workloads that require high resiliency, it is recommended to have one connection at multiple locations. As shown in the figure above, such a topology ensures resilience to connectivity failure due to a fiber cut or a device failure as well as a complete location failure. You can use AWS Direct Connect gateway to access any AWS Region (except AWS Regions in China) from any AWS Direct Connect location.

High Resiliency
24
Q

How to achieve Direct connect - Maximum Resiliency?

A

Maximum resilience is achieved by having two independent connections in each locations. As shown in the figure below, such a topology provides resilience to device failure, connectivity failure, and complete location failure.

25
Q

What is Transit Gateway?

A

AWS Transit Gateway connects your Amazon Virtual Private Clouds (VPCs) and on-premises networks through a central hub. This connection simplifies your network and puts an end to complex peering relationships. Transit Gateway acts as a highly scalable cloud router—each new connection is made only once.

Its original source but it can work cross region. It can be shared across accounts using resource access manager RAM. You can be a transit gateway across regions. You can control which VPC can talk with other VPC by using route tables.

It supports IP Multicast. It’s big clue in the exam.
IP multicast on AWS Transit Gateway makes it easy for customers to build multicast applications in the cloud and distribute data across thousands of connected Amazon Virtual Private Cloud networks. Multicast delivers a single stream of data to many users simultaneously.

26
Q

What is ECMP?

A

ECMP = Equal Cost Multi-path
It’s a routing strategy to allow forwarding a packet over multiple best paths.
Use case: create multiple site-to-site VPN connections to increase the bandhwidth of your AWS connection

27
Q

What is VPC - Traffic Mirroring?

A

Traffic Mirroring is an Amazon VPC feature that you can use to copy network traffic from an elastic network interface of type “interface”. You can then send the traffic to out-of-band security and monitoring appliances for:
1. Content inspection
2. Threat monitoring
3. Troubleshooting
The security and monitoring appliances can be deployed as individual instances, or as a fleet of instances behind either a Network Load Balancer with a UDP listener or a Gateway Load Balancer with a UDP listener. Traffic Mirroring supports filters and packet truncation, so that you only extract the traffic of interest to monitor by using monitoring tools of your choice.

28
Q

What is Egress only Internet gateway?

A

Allows instances in your VPC outbound connections over IPv6 while preventing
the internet to initiate an IPv6 connection to your instances. This is useful for the instances in private subnet. It allows the instances to connect to the internet but it doesn’t allow any connection to the instances.

Routing table should be updated for the same.

29
Q

What is AWS Private Link?

A

PrivateLink is technology allowing you to privately (without Internet) access services in VPCs. These services can be your own, or provided by AWS.

Let’s say that you’ve developed some application and you are hosting it in your VPC. You would like to enable access to this application to services in other VPCs and other AWS users/accounts. But you don’t want to setup any VPC peering nor use Internet for that. This is where PrivateLink can be used. Using PrivateLink you can create your own VPC endpoint services which will enable other services to use your application.

30
Q

What is VPC Sharing?

A

VPC sharing allows multiple AWS accounts to create their application resources, such as Amazon EC2 instances, Amazon Relational Database Service (RDS) databases, Amazon Redshift clusters, and AWS Lambda functions, into shared, centrally-managed virtual private clouds (VPCs).

Using VPC sharing, an account that owns the VPC (owner) shares one or more subnets with other accounts (participants) that belong to the same organization from AWS Organizations. **The owner account cannot share the VPC itself. **

31
Q

What is the difference between NAT gateway and Egrees Internet Only gateway?

A

An egress-only internet gateway is for use with IPv6 traffic only. To enable outbound-only internet communication over IPv4, use a NAT gateway instead. For more information, see NAT gateways.

32
Q

What is the purpose of Internet Gateway?

A

An Internet Gateway serves two purposes:
1. To provide a target in your VPC route tables for internet-routable traffic
2. Perform network address translation (NAT) for instances that have been assigned public IPv4 addresses.

Internet Gateways on their own do not allow Internet access, route tables must also be edited!

33
Q

What configuration is supported by VPN Console wizard?

A

Supported
1. VPC with a single public subnet
2. VPC with public and private subnets (NAT)
3. VPC with public and private subnets and AWS Site-to-Site VPN access
4. VPC with a private subnet only and AWS Site-to-Site VPN access

Not supported
VPC with a public subnet only and AWS Site-to-Site VPN access

34
Q

What NAT Gateway and NAT instances can and cannot do?

A

NAT Gateway doesn’t support port forwarding, cannot be used as bastian host and cannot be associated with security group. NAT instance can do all of it.