Creating a Network Security Group
On Compute Cloud@Customer, you can create Network Security Groups (NSGs).
- Create an NSG as described in this section.
- Add security rules to the NSG. See Managing Network Security Group Rules.
-
Add parent resources (or more specifically, VNICs) to the NSG.
You can do this when you create the parent resource, or you can update the parent resource and add it to one or more NSGs.
When you create a Compute instance and add it to an NSG, the instance's primary VNIC is added to the NSG. Separately, you can create secondary VNICs and optionally add them to NSGs.
Avoid entering confidential information in names and tags.
-
In the Compute Cloud@Customer Console navigation menu, click Networking, then click Virtual Cloud Networks.
- At the top of the page, select the compartment that contains the VCN in which you want to create a subnet.
-
Click the name of the VCN for which you want to create an NSG.
The VCN details page is displayed.
-
Under Resources, click Network Security Groups.
-
Click Create Network Security Group.
-
In the Create Network Security Group dialog box, enter the following information:
-
Name: Enter a descriptive name for the NSG. The name doesn't have to be unique, and it can be changed later. Avoid entering confidential information.
-
Create in Compartment: Select the compartment where you want to create the NSG.
-
-
Tagging: (Optional) Add one or more tags to this resource. Tags can also be applied later. For more information about tagging resources, see Resource Tags.
-
Click Create Network Security Group.
The details page for the new NSG is displayed. You can create security rules and select VNICs to add to the group now, or you can do these tasks later. See Configuring VCN Rules and Options and Configuring VNICs.
-
Use the oci network nsg create command and required parameters to create a new network security group for the specified VCN.
oci network nsg create --compartment-id <compartment_OCID> --vcn-id <vcn_OCID> [OPTIONS]
For a complete list of CLI commands, flags, and options, see the Command Line Reference.
Use the CreateNetworkSecurityGroup operation to create a new network security group for the specified VCN.
For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.