36. Networking ‐ Create Hub VCN. Hub Public Subnet, Hub subnet‐Security list manually - SanjeevOCI/Ocidocs GitHub Wiki
Objective :-
- Create a custom HUB VCN, with custom Public Subnet and custom security list.
- Create a instance in the Custom VCN
- Create Internet Gateway, Route Table & Route table to access the instance in the custom subnet.
Steps :-
- Create HUB VCN
- After a VCN is created, it has a default Route table & Default Security List
- Now create a Public Subnet. Use Mtoolbox to calculate the Subnet CIDR
- Create a New Security List. Also add Ingress/Egress rules in it
- Add the new security list in the Public Subnet
- Now remove the default security list
- Create a New instance in the Custom VCN
- Unable to reach the newly created bastion-server instance as there is no gateway to it
- Let's create a gateway to access the bastion-server
- Even after creating the Internet gateway, we are unable to access the bastion-server through putty. The reason being we have not created a route to the bastion-server
- Go to HUB VCN --> Route Tables --> Create a custom Route Table. Do not touch the default Route Table
- Now update the Default Route table in the Public Subnet with the custom Route Table
Now the Public Subnet is guided by the route defined in the Route Table - [HUB-VDN-PUBLIC-SUBNET-RT]
- Our requirement is that instances in the Public Subnet should be able to connect to outside world. For this, we need to go to the Route Table - [HUB-VDN-PUBLIC-SUBNET-RT] and add a new route rule for the same
Now using this Internet Gateway, instances in the Public Subnet can connect to outside world
- We are now able to access the bastion-server through putty