AWS Networking Facts Flashcards
Can a ENI be moved across AZs?
No. ENIs are specific to subnets since they get an IP address in the subnet’s CIDR range.
You can move a network interface from one instance to another, if the instances are in the same Availability Zone and VPC but in different subnets. e.g. Multihoming.
Can ENIs be detached from an instance?
You can detach secondary network interfaces when the instance is running or stopped. However, you can’t detach the primary network interface.
Can VPCs span AZs and Regions?
VPCs are specific to a Region and hence cannot span a Region.
VPCs can span multiple AZs
What are the 5 IP addresses in each subnet reserved by AWS?
.0 - Network Address .1 - Router address .2- DNS Address .3-Reserved for future use .255 - Broadcast (not supported/hence reserved).
What are the attributes of an ENI?
- A primary private IPv4 address from the IPv4 address range of your VPC
- One or more secondary private IPv4 addresses from the IPv4 address range of your VPC
- One Elastic IP address (IPv4) per private IPv4 address
- One public IPv4 address
- One or more IPv6 addresses
- One or more security groups
- A MAC address
- A source/destination check flag
- A description
Can ENIs support multiple Security Groups?
Yes. An ENI can have up to 5 security groups.
How do multiple SGs work?
A single SG can be associated with multiple ENIs.
A single ENI can have multiple SGs.
When multiple SGs are used, the rules are the product of all of them.
SGs are stateful.
They have an implicit deny - i.e. you can only specify “Allow”.
All rules are evaluated before proceeding (i.e. the rules are OR’ed - so if SG allows a particular traffic even if other don’t explicitly allow, then traffic is allowed)
How do NACLs work?
A single NACL can be associate with multiple subnets.
However, a single subnet can have only one NACL.
NACLs are stateless.
Both “Allow” and “Deny” can be specified.
Rules are evaluated in order.
The very last rule is a DENY ALL.
How do you configure ephemeral ports in NACLs?
- Client initiating connection always chooses the ephemeral port. So, inbound/outbound rules have to be specified according to who the client is.
- Ephemeral ports vary based on operating system.
- In general, it is best to have inbound/outbound ports opened from 1024-65536 to cover all OS.
- You can have a specific DENY rule earlier to deny traffic from malicious ports, before the rule that allows such a broad range of ports.
What port does the “Port Range” in SGs rules refer to?
The port ranges are all destination ports - NOT source ports.
What’s the difference between default NACL and Custom NACL?
Your VPC automatically comes with a modifiable default network ACL. By default, it allows all inbound and outbound IPv4 traffic and, if applicable, IPv6 traffic.
You can create a custom network ACL and associate it with a subnet. By default, each custom network ACL denies all inbound and outbound traffic until you add rules.
What’s the difference between default SG and Custom SG?
Your VPC automatically comes with a default security group. All inbound traffic (from itself) is permitted. All outbound traffic is permitted.
When you create a new security group, it has no inbound rules. Therefore, no inbound traffic originating from another host to your instance is allowed until you add inbound rules to the security group.
By default, a security group includes an outbound rule that allows all outbound traffic.
What does statefulness for SG mean?
It means that if inbound traffic is permitted, then the corresponding outbound traffic is also permitted - i.e. the outbound rules are not evaluated and vice versa.
What makes a subnet public?
A public subnet is a subnet that’s associated with a route table that has a route to an Internet gateway.
Note also that: instances in the subnet must have a globally unique IP address (EIP, IPv4 or IPv6). Or else, they must use a NAT GW or instance if they only have a private address.
Additionally, NACLs and SGs must permit the relevant traffic.
What are the different types of VPC Endpoints?
Interface Endpoints
Gateway Load Balancer Endpoints
Gateway Endpoints
What are the functions of the IGW?
IGW performs two functions:
a) to provide a target in your VPC route tables for internet-routable traffic, and
b) to perform network address translation (NAT) for instances that have been assigned public IPv4 addresses.
What are CIDR Range limitations in VPC Peering?
The requester and acceptor VPCs cannot have overlapping CIDR ranges.
However, a hub VPC can peer with two spoke VPC with overlapping CIDR range. The two spoke VPCs essentially communicate with different subnets in the hub VPC each with their own route table pointing to a different peering connection.
In VPC Peering, what is the impact of Regions on Security Groups?
Peer VPCs can be in the same account, different account in the same Region or in different Regions.
When VPCs are in the same Region, the SGs can reference each other in the SG-rules.
Across Regions, the SG rules have to use CIDR blocks.
If SG reference is “Stale” -that indicates that the peer deleted the referenced SG or the peering connection itself is terminated.
How does DNS resolution work in VPC Peering?
By default, if instances on either side of a VPC peering connection address each other using a public DNS hostname, the hostname resolves to the instance’s public IP address. To change this behavior, enable DNS hostname resolution for your VPC connection. After enabling DNS hostname resolution, if instances on either side of the VPC peering connection address each other using a public DNS hostname, the hostname resolves to the private IP address of the instance.
Where can VPC Flow Logs be attached?
a) VPC
b) Subnet
c) ENI.
Can capture Accepted, Rejected or All traffic.
Different combinations can be setup - e.g. one VPC Flow Log for accepted and another for rejected.
Flow Logs cannot be modified once created. Delete and recreate.
Flow Logs are NOT real-time. There may be a delay of up to 5 minutes (for Cloudwatch) and up to 10 minutes (for S3) after the close of the aggregation window.
They are customizable; can be stored to S3 or Cloudwatch. Some fields can only be captured to S3.
What are the fields in Flow Logs?
There are two FL formats a) Default and b) Custom.
Default cannot be modified - a subset of all available fields. Includes version#, acct id, interface id, src/dst port/IP, protocol, pkt, bytes, time (start and end), action (accept/reject), status (OK, NO DATA, SKIP DATA).
Custom formats are customizable.
What is a Flow Log Aggregation Interval?
This specifies the capture window. Default is the maximum of 10 minutes.
You can set it to 1 minute, but this would mean more logs.
What traffic does VPC Flow Logs NOT capture?
a) Traffic to Amazon DNS Server
b) Windows instance license activation
c) Instance metadata to 169.254.169.254
d) Traffic to time sync: 169.254.169.123
e) DHCP
f) Traffic to VPC Router
g) Traffic between an ENI and ELB.
How does FL integrate with CW?
When publishing to CloudWatch Logs, flow log data is published to a log group, and each network interface has a unique log stream in the log group. Log streams contain flow log records.