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
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/ Server Migration Service/ FAQs/ Migration Network/ How Do I Configure a Source Server to Access Huawei Cloud Through a Proxy?

How Do I Configure a Source Server to Access Huawei Cloud Through a Proxy?

Updated on 2025-01-24 GMT+08:00

Scenarios

Each source server must continuously communicate with SMS over the Internet. If the source server cannot access the Internet, you can configure a proxy for it.

NOTICE:

The IP address and port number in this section are used as examples only.

Preparations

  • Prepare a proxy server.
    NOTE:

    The proxy server and the source server must be able to communicate with each other over the intranet.

  • Obtain the Squid installation package.

Step 1: Configure the Proxy Server

  • Installing and configuring Squid on Linux
    1. Run the following command on the proxy server to install Squid:
      yum -y install squid
    2. Run the following command to back up the Squid configuration file:
      cp -a /etc/squid/squid.conf /etc/squid/squid.conf.bak
    3. Use the text editor to modify the squid.conf configuration file and save the modification.
      vi /etc/squid/squid.conf
      1. Configure Squid as a proxy for the network segment where the source server is located. Replace 192.168.0.0/16 with the private IP address of the server that needs to access the proxy server. Generally, it is set to the private network segment of the source server. You can also set it to 0.0.0.0/0 to allow access from all servers.
        acl localnet src 192.168.0.0/16 

      2. Add the following configuration items:
        cache_mem 64 MB
        maximum_object_size 4 MB
        cache_dir ufs /var/spool/squid 100 16 256
        access_log /var/log/squid/access.log
      3. (Optional) Check that http_port is set to the Squid port in the configuration file. The default value is 3128. You can change it if necessary.
    4. Start Squid.
      systemctl start squid
    5. Check the Squid status.
      systemctl status squid
    6. (Optional) Configure Squid to automatically start upon system startup.
      systemctl enable squid
  • Installing and configuring Squid on Windows
    1. On the server you prepared, access https://squid.diladele.com. Locate Console APP, download the installation program, and install it.

    2. After the installation is complete, go to the Squid installation directory and modify the squid.conf file in the etc/squid folder.
      1. Configure Squid as a proxy for the network segment where the source server is located. Replace 192.168.0.0/16 with the private IP address of the server that needs to access the proxy server. Generally, it is set to the private network segment of the source server. You can also set it to 0.0.0.0/0 to allow access from all servers.

      2. (Optional) Check that http_port is set to the Squid port in the configuration file. The default value is 3128. You can change it if necessary.
    3. Right-click the Squid icon on the taskbar at the lower right corner and choose Exit from the shortcut menu.
    4. Double-click the Squid Server Tray icon on the desktop to start Squid. Right-click the Squid icon on the taskbar in the lower right corner and choose Start Squid Service from the shortcut menu.
    5. Run the following command in the CLI window to check whether Squid is running:
      netstat -ano | findstr 3128

Step 2. Install the Agent on the Source Server

  • Linux
    1. Run the following command on the source server to download the Agent:
      curl -x http://<proxy-server-private-IP-address>:<proxy-port> -O https://sms-resource-intl-ap-southeast-3.obs.ap-southeast-3.myhuaweicloud.com/SMS-Agent.tar.gz
    2. Decompress the installation package.
      tar -zxvf SMS-Agent.tar.gz
    3. Use the text editor to modify the auth.cfg file in the SMS-Agent/agent/config directory and save the modification.
      vim SMS-Agent/agent/config/auth.cfg

      NOTE:
      • enable indicates whether to use a proxy. If it is set to true, a proxy is used.
      • proxy_addr indicates the private IP address of the proxy server, not the IP address of the target server.
      • proxy_port indicates the port specified for Squid.
    4. Go to the SMS-Agent installation directory and run the startup.sh script to start the Agent. When prompted, enter the AK/SK pair of your target Huawei Cloud account and the SMS domain name.

      When the following information is displayed, the Agent has been started up and will automatically start reporting source server information to SMS.

  • Windows
    1. Download and install the Agent on the source server.
      • If the source server runs Windows Server 2019, Windows Server 2016, Windows Server 2012, Windows 10, or Windows 8.1, run the following command in PowerShell on the source server to download the Agent:
        Invoke-WebRequest -Proxy http://<proxy-server-private-IP-address>:<proxy-port> -Uri
        https://sms-resource-intl-ap-southeast-3.obs.ap-southeast-3.myhuaweicloud.com/SMS-Agent-Py3.exe -OutFile C:\\SMS-Agent-Py3.exe -UseBasicParsing
      • If the source server runs Windows Server 2008 or Windows 7, download the Agent (Python 2) from the proxy server, upload the Agent package to the source server, and install the Agent. For details, see Installing the Agent on Windows.
    2. Start the Agent
      • If you use the Agent (Python 3), on the SMS-Agent GUI, enter the AK/SK pair of the target Huawei Cloud account and the SMS domain name, select Use proxy, enter the private IP address and port of the proxy server, and click Start. In this example, no username and password are required for using the proxy.

      • If you use the Agent (Python 2), go to the Agent installation directory, for example, C:\SMS-Agent-Py2\config, modify the auth.cfg file based on the following figure, and save the modification.

        NOTE:
        • enable indicates whether to use a proxy. If it is set to true, a proxy is used.
        • proxy_addr indicates the private IP address of the proxy server, not the IP address of the target server.
        • proxy_port indicates the port specified for Squid.

        Double-click agent-start.exe in the installation directory (for example, C:\SMS-Agent-Py2) to open the SMS-Agent CLI. Enter the AK/SK pair of the target Huawei Cloud account and the SMS domain name to start the Agent.

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