IP Addresses for Resources in GCP
- GCP IP Addressing
- There are two types of IP Addresses
- Internal Address
- Assigned from the subnet range using internal DHCP pool
- IP Addressing can be further classified into
- Ephemeral : This will still remain even after vm is stoppedd
- Static Ip Address: Can be assigned to any ip in the subnet range
- Internal DNS Format is assigned (FQDN): (instance-name).c.(project-id).intenral
- External Address
- Assigned to be access from internet
- IP Addressing can be further classified into
- Ephemeral: This changes when you stop the vm i.e. the ip address is released and when you start the vm you will get a new external ip address
- Static Ip Address: We can reserve the Static ip and this will remain the same across vm starts and stops.
- No default public DNS, need to use DNS Services like Cloud DNS
- Internal Address
- Multiple Network Interface Controllers (NIC):
- VMs can have exactly one internal and external IP per VPC
- VM can have multiple network interfaces (one per vpc) with external and internal ip addresses
- Restrictions:
- 1 NIC per network
- Two networks cannot have overlapping subnet ranges
- Maximum of 8 NICs can be assigned to VM
- less than or equal to 2 VCPUs = 2 NICS
- grater than 2 CPUs => 1 NIC per CPU
- NIC’s can be assigned only during vm creation
Exercise:
- Create a custom vpc with two subnets
- name: vpca
- us-central1 : 192.168.0.0/24
- us-east1: 192.168.1.0/24
- Create a custom vpc with two subnets
- name: vpcb
- us-central1 : 10.168.0.0/24
- us-east1: 10.168.1.0/24
- Now lets create a compute engine instance in any of the vpc’s
- We can continue instance creation but lets add one more network interface from different vpc
Next Steps:
- Understanding firewalls
- Understanding Routes