36. Networking ‐ Create Hub VCN. Hub Public Subnet, Hub subnet‐Security list manually - SanjeevOCI/Ocidocs GitHub Wiki

Objective :-

  1. Create a custom HUB VCN, with custom Public Subnet and custom security list.
  2. Create a instance in the Custom VCN
  3. Create Internet Gateway, Route Table & Route table to access the instance in the custom subnet.

Steps :-

  1. Create HUB VCN

New_HUB_VCN_1

New_HUB_VCN_2

  1. After a VCN is created, it has a default Route table & Default Security List

New_HUB_VCN_3

  1. Now create a Public Subnet. Use Mtoolbox to calculate the Subnet CIDR

New_HUB_VCN_6

New_HUB_VCN_4

New_HUB_VCN_5_1

New_HUB_VCN_5_2

New_HUB_VCN_5_3

New_HUB_VCN_5_4

New_HUB_VCN_5_5

  1. Create a New Security List. Also add Ingress/Egress rules in it

New_HUB_VCN_7_1

New_HUB_VCN_7_2

New_HUB_VCN_7_3

New_HUB_VCN_7_4

New_HUB_VCN_7_5

New_HUB_VCN_7_6

New_HUB_VCN_7_7

New_HUB_VCN_7_8

  1. Add the new security list in the Public Subnet

New_HUB_VCN_8_1

New_HUB_VCN_8_2

New_HUB_VCN_8_3

New_HUB_VCN_8_4

  1. Now remove the default security list

New_HUB_VCN_8_5

New_HUB_VCN_8_6

  1. Create a New instance in the Custom VCN

New_HUB_VCN_9_1

New_HUB_VCN_9_2

New_HUB_VCN_9_3

New_HUB_VCN_9_4

  1. Unable to reach the newly created bastion-server instance as there is no gateway to it

New_HUB_VCN_9_5

  1. Let's create a gateway to access the bastion-server

New_HUB_VCN_10_1

New_HUB_VCN_10_2

New_HUB_VCN_10_3

  1. 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

New_HUB_VCN_9_5

  1. Go to HUB VCN --> Route Tables --> Create a custom Route Table. Do not touch the default Route Table

New_HUB_VCN_11_1

New_HUB_VCN_11_2

New_HUB_VCN_11_3

  1. Now update the Default Route table in the Public Subnet with the custom Route Table

New_HUB_VCN_12_1

New_HUB_VCN_12_2

Now the Public Subnet is guided by the route defined in the Route Table - [HUB-VDN-PUBLIC-SUBNET-RT]

New_HUB_VCN_12_3

  1. 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

New_HUB_VCN_13_1

New_HUB_VCN_13_2

Now using this Internet Gateway, instances in the Public Subnet can connect to outside world

New_HUB_VCN_13_3

  1. We are now able to access the bastion-server through putty

New_HUB_VCN_14_1

We have successfully created a custom HUB VCN, with custom Public Subnet and custom security list. Also created a new instance in the Custom VCN and made it accessible using Internet Gateway, Route Table & Route table