Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Elastic Cloud Server/ Troubleshooting/ General Issues/ Why Am I Unable to Connect to a Port on an ECS?

Why Am I Unable to Connect to a Port on an ECS?

Updated on 2023-04-03 GMT+08:00

Scenarios

A connection to an ECS on a specific port may be prevented for multiple reasons, for example, a security group is blocking traffic to the port.

This section uses port 80 as an example to describe how to troubleshoot an unreachable ECS port.

Locating the Fault

If the ECS cannot provide the HTTP service, check whether the port used by the web service (TCP port 80 by default) is working properly.

  1. On the ECS management console, ensure that the port is permitted in the security group.
  2. Remotely log in to the ECS and ensure that HTTP is enabled on it.
  3. Ensure that the port is listened to properly. If it is not, change the listened IP address.
  4. Ensure that HTTP is permitted on the ECS firewall.

Windows

The following uses an ECS running Windows Server 2012 with Internet Information Services (IIS) deployed as an example.

  1. Ensure that port 80 is permitted in the security group.

    1. Log in to the management console.
    2. Click in the upper left corner and select your region and project.
    3. Under Compute, click Elastic Cloud Server.
    4. On the Elastic Cloud Server page, click the name of the target ECS.

      The page providing details about the ECS is displayed.

    5. Click the Security Groups tab and view security group rules.
    6. Make sure that the following security group rules have been added to the security group to which the ECS belongs:

  2. Remotely log in to the ECS and verify that IIS is enabled on it.

    1. In the Server Manager window, choose Tools > Internet Information Services (IIS) Manager.

      If this option is unavailable, IIS is not successfully deployed. In such a case, deploy IIS again.

    2. In the Internet Information Services (IIS) Manager window, check the following information:
      • In the Connections navigation pane, right-click the ECS ID. If Connect is unavailable, IIS has been enabled.
      • Click Sites. Then, view the website status on the right side of the page. If the website is stopped, click the website and then Start under Manage Server on the right side of the page to start the website.

  3. Check whether the port is properly listened to on the ECS.

    Open the cmd window and run the following command:

    netstat -ano | findstr: 80

    If information similar to the following is displayed, port 80 is being properly listened to on the entire network. If it is not, change the listened IP address.

  4. Ensure that HTTP is permitted on the firewall.

    1. Choose Control Panel > Windows Firewall.
    2. Perform operations based on the firewall status.
      • If the firewall is disabled, no further action is required.
      • If the firewall is enabled, perform the following operations:
        1. Click Advanced settings.
        2. In the navigation pane, click Inbound Rules.
        3. Select World Wide Web Services (HTTP Traffic-In). If it is disabled, enable the rule.

Linux

The following uses an ECS running CentOS 7 with Nginx deployed as an example.

  1. Ensure that port 80 is permitted in the security group.

    1. Log in to the management console.
    2. Click in the upper left corner and select your region and project.
    3. Under Compute, click Elastic Cloud Server.
    4. On the Elastic Cloud Server page, click the name of the target ECS.

      The page providing details about the ECS is displayed.

    5. Click the Security Groups tab and view security group rules.
    6. Make sure that the following security group rules have been added to the security group to which the ECS belongs:

  1. Remotely log in to the ECS and ensure that Nginx is enabled on it.

    Run the following command to check whether Nginx has been enabled:

    systemctl status nginx

    If the following information is displayed, Nginx has been enabled:

    If Nginx has not been enabled, run the following command to enable it:

    systemctl start nginx

  2. Run the following command to check whether the port is properly listened to on the ECS:

    netstat -an | grep 80

    If information similar to the following is displayed, port 80 is being properly listened to on the entire network. If it is not, change the listened IP address.

    tcp   0 0 0.0.0.0:80    0.0.0.0:*     LISTEN

  3. View the iptables rules of the ECS firewall.

    • Run the following command to view the firewall status:

      systemctl status firewalld

      or

      firewall-cmd --state

    • If the firewall is disabled, run the following command to enable it.

      systemctl start firewalld

      If "Failed to start firewalld.service: Unit is masked." is displayed after the command is executed, run the following command and then run the preceding command to enable the firewall again:

      systemctl unmask firewalld

    • Run the following command to view the allowed ports:

      firewall-cmd --zone=public --list-ports

    • Run the following command to allow TCP port 80:

      firewall-cmd --zone=public --add-port=80/tcp --permanent

    • Run the following command to update the firewall rules:

      firewall-cmd --reload

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback