tencent cloud

Virtual Private Cloud

Release Notes and Announcements
Release Notes
Announcements
Tencent Cloud Network Overview
Product Introduction
Overview
Strengths
Use Cases
Concepts
Quota Limit
Service Regions and Service Providers
Purchase Guide
Billing Overview
Payment Overdue
Quick Start
Network Planning
VPC Connections
Building Up an IPv4 VPC
Operation Guide
Network Topology
Network performance dashboard
Virtual Private Cloud (VPC)
Subnets
Route Tables
Elastic IP
HAVIPs
Elastic Network Interface
Bandwidth Package
Network Connection
Security Management
Diagnostic Tools
Alarming and Monitoring
Practical Tutorial
View the Total Bandwidth for Single-Region Traffic-Based Billing
Migrating from the Classic Network to VPC
Best Practices of Security Group Change
Configuring CVM Instance as Public Gateway
Building HA Primary/Secondary Cluster with HAVIP + Keepalived
Hybrid Cloud Primary/Secondary Communication (DC and VPN)
Hybrid Cloud Primary/Secondary Communication (CCN and VPN)
CVM Access to Internet Through EIP
Troubleshooting
VPCs or Subnets Cannot Be Deleted
Network Disconnection After Connecting Two VPCs over CCN
Failed to Ping CVMs in the Same VPC
API Documentation
History
Introduction
API Category
Making API Requests
VPC APIs
Route Table APIs
Elastic Public IP APIs
Elastic IPv6 APIs
Highly Available Virtual IP APIs
ENI APIs
Bandwidth Package APIs
NAT Gateway APIs
Direct Connect Gateway APIs
Cloud Connect Network APIs
Network ACL APIs
Network Parameter Template APIs
Network Detection-Related APIs
Flow Log APIs
Gateway Traffic Monitor APIs
Private Link APIs
Traffic Mirroring APIs
Other APIs
Subnet APIs
VPN Gateway APIs
Security Group APIs
Snapshot Policy APIs
Error Codes
Data Types
FAQs
General
Connection
Security
Contact Us
Glossary

Adding a Security Group Rule

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-11-24 17:39:12

Operation Scenario

Security groups are used to determine whether to permit access requests from the Internet or private networks. For security considerations, access denial is adopted in the inbound direction in most cases. If you select the "Open all ports to the Internet" or "Open ports 22, 80, 443, and 3389 and the ICMP protocol to the Internet" template when creating a security group, the system will automatically add security group rules for some communication ports based on the selected template.

This document describes how to add security group rules to allow or forbid CVMs in a security group to access the Internet or VPC instances.

Notes

Security group rules are divided into IPv4 and IPv6 security group rules.
Open all ports is applicable to both IPv4 and IPv6 security group rules.

Prerequisites

You have created a security group.
You know what Internet or private network access requests need to be permitted or rejected for your CVM instance. For more use cases of security group rule settings, see Security Group Use Cases.

Steps

1. Log in to CVM Console.
2. In the left sidebar, click Security Group to enter the security group management page.
3. On the security group management page, choose Region, and locate the row of the security group for which you want to set rules.
4. In the operation column, click Modify Rules.
5. On th
e securi
ty group rule page, click Inbound rules, and select one of the following modes based on your actual needs to complete the operation.
Note
The following operation examples use mode 2 (adding rules).
Mode 1 (open all ports): is applicable to scenarios in which ICMP protocol rules do not need to be set and operations can be done through ports 22, 3389, 80, 443, 20, and 21, as well as the ICMP protocol.
Mode 2 (adding rules): is applicable to scenarios in which multiple communication protocols, such as ICMP, need to be set.
6. In the Add Inbound Rules window that appears, set rules. The main parameters required for adding a rule are as follows:
Type: the default value is "Custom". You can also select another system rule template, such as "Windows login", "Linux login", "Ping", "HTTP (80)", or "HTTPS (443)".
Source/Destination: the source (inbound rules) or destination (outbound rules) of traffic. Choose one of the following options:
Specified Source/Destination
Description
An IPv4 address or IPv4 address range
Specify it in CIDR notation (for example, 203.0.113.0, 203.0.113.0/24, or 0.0.0.0/0, where 0.0.0.0/0 indicates that all IPv4 addresses will be matched).
An IPv6 address or IPv6 address range
Specify it in CIDR notation (for example, FF05::B5, FF05:B5::/60, ::/0, or 0::0/0, where ::/0 or 0::0/0 indicates that all IPv6 addresses will be matched).
Import security group ID: you can import the following security group IDs:
Security group ID
Another security group
The current security group refers to the CVMs associated with the security group.
Another security group refers to the ID of another security group under the same project in the same region.
Import the IP address object or IP address group object in the parameter template
-
Protocol port: enter the protocol type and port range, or import a protocol port or protocol port group in the parameter template.
Policy: the default value is "Permit".
Permit: permit access requests over the port.
Reject: discard data packets directly without returning any response.
Remarks: briefly describe the rule to facilitate future management.
7. 
Click
Finish. Inbound rules are added to the security group.
8. On the security group rule page, click Outbound Rules, and add outbound rules to the security group by referring to Step 5 to Step 7.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백