Create and Configure a Public Subnet in a VCN
Before you can run VMs in another compartment's VCN, you must first create a public subnet in your VCN with security rules that allow inbound access from and outbound access to VB Studio.
- Sign in to Oracle Cloud Console.
- In the upper-left corner, click Navigation Menu
.
- Select Networking and select Virtual Cloud Networks.
- Under List Scope, select the compartment.
- From the VCNs list, click the VCN's name.
- Under Resources, click Security Lists, and then click Create Security List.
- In Name, enter a name for the security list.
- In Create in Compartment, ensure that the correct compartment is selected.
- In Allow Rules for Ingress, click + Another
Ingress Rule and follow these steps:
- In Source Type, select CIDR.
- In Source CIDR, enter
0.0.0.0/0
. - In Destination Port Range, enter
9082
. - (Optional) In Description, add a
description.Here's an example:
- Click + Another Ingress Rule and repeat steps 9a through 9d to add ports 9085 and 22.
- (Only if you are using Docker executors) Click + Another
Ingress Rule and repeat steps 9a
through 9d
to add ports 8095 and
9001-9010 to
0.0.0.0/0
and add port 443 to your VCN CIDR (for example10.0.0.0/16
).
- In Allow Rules for Egress, click + Another
Egress Rule and follow these steps:
- In Source Type, select CIDR.
- In Source CIDR, enter
0.0.0.0/0
. - In IP Protocol, select All Protocols.
- (Optional) In Description, add a description.
- Click Create Security List.After creating the security list, click its name to verify the ingress and egress rules you added.
Here's an example of ingress rules:
Here's an example of the egress rule:
- Return to the VCN's details page.
- Under Resources, select Subnets
and follow these steps to create a public subnet:If you want to edit an existing public subnet, jump to the next step.
- Click Create Subnet.
- In Name, enter the subnet's name.
- In Create in Compartment, select the correct compartment.
- In Subnet Type, make sure that Regional is selected.
- In CIDR Block, enter the subnet's CIDR
block.Don't set it to
172.17.0.0/16
as it's the default subnet allocated to Docker. - In Route Table, select the VCN's route table.
- In Subnet Access, make sure that Public Subnet is selected.
- In DHCP Options, select the VCN's DHCP options.
- In Security List, select the security list you created in step 6.
- Fill in the other fields as required.
Here's an example:
- Click Create Subnet.
- If you want to edit an existing subnet, follow these steps:
- Under Resources, select Subnets and click the public subnet's name.
- Click Add Security List.
- In the Add Security List dialog box, in Security List, select the security list you created in step 6.
- Click Add Security List.
That's it. After creating or editing the public subnet, your VM executors can now run in the VCN.