Adding or Removing a VNIC from a Network Security Group

Learn to add or remove a VNIC from a network security group.

You can change which network security groups (NSGs) a VNIC belongs to, or remove a VNIC from all NSGs.

    1. Confirm you're viewing the compartment that contains the Compute instance you're interested in.
    2. Open the navigation menu and click Compute. Under Compute, click Instances.
    3. Click the name of the instance to view its details.
    4. Under Resources, click Attached VNICs.
      The primary VNIC and any secondary VNICs attached to the instance are displayed.
    5. Click the name of the VNIC you're interested in.
      Each VNIC's details page includes a list of the NSGs that the VNIC belongs to (if any).
    6. Next to Network Security Groups, click Edit.
    7. Make your changes. Avoid entering confidential information. Then, click Save Changes.
  • Use the oci network vnic update command and required parameters to add or remove a VNIC from a network security group:

    oci network vnic update --vnic-id ocid --nsg-ids list of NSG ocids ... [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the UpdateVnic operation to add or remove a VNIC from a network security group.