Help Center/ Server Migration Service/ FAQs/ Migration Network/ How Do I Configure a Source Server to Access Huawei Cloud Through a Proxy?
Updated on 2024-08-22 GMT+08:00

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

Scenarios

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

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

Preparations

  • Prepare a CentOS server that will serve as a proxy server. CentOS 7.2 64-bit is used as an example here.

    The proxy server must be able to communicate with the source server over the private network.

  • Obtain the Squid installation package.

Procedure

  1. Install and configure Squid on the CentOS server.

    1. Install Squid.

    2. Edit the squid.conf file as follows.

      http_port 3128
      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
      acl localnet src 192.168.0.0/16
      http_access allow localnet
      http_access deny all

      http_port is the port specified for Squid. acl localnet src is the private IP address of the source server that needs to access the Internet using the proxy server. You can also set acl localnet src to 0.0.0.0/0 to allow access from all servers.

    3. Initialize Squid.

    4. Start Squid and set it to automatically start upon system boot.

  2. Configure the source server to access the Internet through the proxy server.

    • Linux

      Create a /etc/profile.d/proxy.sh file, edit the file, and then run source /etc/profile.

      Set export https_proxy to the private IP address and port of the proxy server. In this example, 192.168.10.72:3128 indicates that the source server will access the Internet over port 3128 of the proxy server whose IP address is 192.168.10.72.

    • Windows

      Open a browser, for example, Internet Explorer. Choose Tools > Internet Options > Connections > LAN Settings. In the Proxy Server area, set the parameters as follows.

      Address and Port are the private IP address and port of the proxy server. In this example, the source server will access the Internet over port 3128 of the proxy server whose private IP address is 192.168.10.72.

  3. Perform the following operations on the source server to register it with SMS using the Agent through the proxy.

    • Linux
      1. Download the Agent installation package.
        curl -O https://sms-agent-2-0-cn-north-1.obs.cn-north-1.myhuaweicloud.com/SMS-Agent.tar.gz
      2. Decompress the installation package.
        tar -zxvf SMS-Agent.tar.gz

      3. Go to the SMS-Agent/agent/config directory and modify the auth.cfg file.

        proxy_addr indicates the private IP address of the proxy server that the source server uses to access SMS. proxy_port indicates the proxy port over which the source server accesses SMS.

      4. Enter the AK/SK pair of the Huawei Cloud account you will use for migration as prompted.

        When the message "sms agent starts up successfully" is displayed, the Agent has started and will start reporting source server information to SMS.

    • Windows
      1. Download and install the Agent on the source server.

        For details, see Installing the Windows Agent.

      2. In the displayed SMS-Agent GUI, enter the AK/SK pair of the Huawei Cloud account you will use for migration, and click Start.
        • If you do not need to use an HTTPS proxy, select Directly connection.
        • If you need to use an HTTPS proxy, select Use proxy and enter the IP address, port number, username, and password of the proxy server. Ignore Proxy user name and Password because no username or password is configured for the proxy server in this example.

        proxy_addr indicates the private IP address of the proxy server that the source server uses to access SMS.

        When the message "Upload success. Waiting for the SMS instruction" is displayed, the Agent has been started. You need to log in to the SMS console and perform subsequent operations.

        After a Windows source server is migrated, you are advised to reset the browser proxy settings to avoid its effects on the source server.