36: OCI: NW ‐ Create a instance in HUB‐VCN‐PUBLIC‐Subnet and establish the connectivity - pavankumarchittajallu/OCI_DOC GitHub Wiki

step-by-step process to create an instance in the HUB-VCN-PUBLIC-Subnet in OCI and establish its connectivity:

1. Prepare Network Components

  • Ensure the following are already set up (based on your previous config):
    • HUB VCN with a public subnet.
    • Internet Gateway attached to that VCN.
    • Custom Route Table with a 0.0.0.0/0 rule pointing to the Internet Gateway.
    • Appropriate Security List or NSG allowing required inbound (e.g., SSH on port 22, HTTP/HTTPS on ports 80/443) and outbound rules.

2. Launch the Compute Instance

  1. Log in to OCI Console.
  2. In the navigation menu, go to Compute > Instances.
  3. Click Create Instance.

3. Configure Basic Instance Options

  • Name: Enter a friendly name.
  • Compartment: Choose the compartment where HUB VCN resides.
  • Availability Domain: Select as required (usually “AD1” is fine).

4. Select Image and Shape

  • Image: Choose an OS image (e.g., Oracle Linux, Ubuntu, Windows).
  • Shape: Select a compute shape (VM.Standard type is common for testing).

5. Configure Networking

  • Virtual Cloud Network (VCN): Select the HUB VCN.
  • Subnet: Select the public subnet (HUB-VCN-PUBLIC-Subnet).
  • Assign public IP address: Set to Yes (essential for direct Internet access).

6. Add SSH Keys

  • Paste your public SSH key or generate one in OCI.
  • Save the private key securely on your desktop—you’ll use it to connect.

7. Finish and Launch

  • Review the settings.
  • Click Create.
  • The instance will move from “Provisioning” to “Running” state.

8. Establish Connectivity (Test SSH)

  1. Get the instance’s public IP address from the instance details page.
  2. From your terminal, connect using:
    ssh -i /path/to/private_key opc@
    
    • Replace /path/to/private_key with your private key file location.
    • Replace `` with the public IP address of the instance.
  • If you can connect, Internet access is working.

9. (Optional) Validate Outbound Access

  • SSH into the instance and run:
    curl https://www.oracle.com
    
    • Success indicates outbound Internet is configured.

Summary Table

Step Console Section / UI Setting / Action
Prepare Network Networking / VCN IGW, Route Table, Security List/NSG
Create Instance Compute > Instances Name, Compartment, AD
Image & Shape Image/Shape step Pick OS, shape
Configure Networking Instance creation, Networking block HUB VCN, Public Subnet, Assign public IP = Yes
Add SSH Key SSH Key section Paste or generate, save private key
Launch Review + Create -
Establish Connectivity Use SSH terminal Connect as opc@