VPC Cantrill
VPC Cantrill
** when designing note the ip ranges to avoid , how many subnets , IPs per subnet.
can add ipv4 secondary blocks . up to 5 blocks per account .
FOR IPB6 BLOCKS , you can use one assigned by aws or one you owned .
VPC is within a region . A subnet is linked to an AZ .
By default VPC is isolated from the internet and public AWS zone except the default
VPC .
One default VPC per region . You can remove it and recreate it . 172.31.0.0/16
The VPC router takes care of routing inside the VPC and outside . it has one
interface in each subnet .
Only one igw per VPC . VPC CIDR from /16 to /28 .
You can create max 5 VPC per region .
Subnet are created based on the primary or secondary VPC cidr
The cidr block must not overlap with existing cidr associated with the vpc .
you cannot change the cidr and subnet mask once created
Consider deploying application tiers per subnet
Egress only Internet Gateway is used for ipv6 addresses to access internet .
enbale dns hostname helps an instance to get a public dns name if a public ip was
assigned
By default subnets can communicate with other subnets in the vpc
netw +1 vpc router : used to me data between subnets and out of the vpc . it has an
interface in each subnets
netw +2 dns ( enableDnsSupport / enableDnsHostnames : gives instances DNS Names)
netw +3 reserved
one DHCP option set per VPC at one time . You can change the options set but you
cannot edit them .
dont forget to enable auto assign public ipv4 address or auto assign ipv6
Each subnet has one route table (has to have) . one route table can be associated
to many vpc . netw+1 address . VPC has a MAIN route table .
local = in the VPC itself . Local routes always takes priority even against a
higher prefix lentgh .
Each VPC has one or 0 igw . 1 igw can only be attached to one VPC .
can assign same igw for ipv4 and v6
Gateways traffic betwwen VPC and internet or AWS public zone .
Once an igw route is in a subnet , its a public subnet .
The instance (OS) itself doesnt get the public IPV4 , a record is created on the
igw . For ipv6 , the instance does have the address .
custom NACLs can be create for a specific VPC . cannot be assigned to AWS resources
.
each subnet can hace on nacl and one , no explicit deny )cannot block specific
addresses like nacl . They are attached to an ENI .
Use a Nat gateway to make private instances access the internet . The Nat gateway
is located in the public subnet to have a route to the internet via the igw .
The default route for private instances , points to the NAT gateway .
The NAT gateway maintains a Translation table . It uses its public own ip add to
connect to the IGW . The IGW translates the NAT gatw ip to a real public ip .
Runs from public subnet because it needs to be assigned a public ip for itself .
NAT GAteways uses EIPs. AZ resilient service . For region resilience , deploy a
One NAT gateway per AZ and add default route in each subnet .
Charged based on data processed ( /GB) and usage hour .
( to use nat instance , disable soure/dest checks ; NAT instance can be cheaper ,
more flexible ) . nat gateway is AZ resilience but nat instance are not .
Sg only apply to nat instances , nacl apply to both .
sg self references scales with adds and removes from the sg .
nat and nat gateway dont work with ipv6 .
VPC flow logs only capture packets metadata , not content . For content you need a
packet sniffer .
can be applied at the VPC , Subnet , ENI level . They are not real time .
Logs Destinations can be S3 or CloudWatch . with S3 , you can access the logs and
integrate them with third party monitoring tool .
With cloudwatch logs , you can integrate wiht other product , access it
programmatically or using the cloudwatch console .
.Athena can be used to query those logs in S3 .
Flow logs capture from the capture point down .
Version account-id interface-id srcip dstip srcprt dstprt proto packets bytess
start end action log-status .
Some data are not recorded by flow logs . metadata address , dhcp within vpc ,
ntp , amazon windows licence server , amazon dns server .
Egress only gat is HA by default for all AZs . to use it , add a default route in
the subnet pointing to the eigw-id .
**VPC peering : direct encrypted ntwk link between two VPCs through aws global
secure network ( no more than 2) . works same / cross region and cross account .
(optional) Public Hostnames resolve to private IPs .
Same region SG's can reference peer SGs . ( only in same region) . VPC peering is
not transitive .
Routing config is needed , Sgs and NACLs can filter .
invite and accept architecture . for ping to work , create icmp rule .
dhcp option set / vpc and subnet interface / sg self reference / one nat gateway /
nat ga - nat inst / global accelerator / in private or public subnet / aws global
network /