Help Center> Object Storage Service> Best Practices> Accessing OBS over Intranet> Accessing OBS over Intranet by Using obsutil on a Linux ECS
Updated at: 2022-03-29 GMT+08:00

Accessing OBS over Intranet by Using obsutil on a Linux ECS

obsutil is a command line tool applicable to Windows and Mac operating systems. You can configure the intranet DNS server address to access OBS over intranet on a HUAWEI CLOUD Linux ECS. The process and procedure are described as follows.

You need to download obsutil over the Internet. Alternatively, you can download obsutil on a cloud server that can access the Internet and then transfer the downloaded obsutil to the current cloud server for installation.

Process

Figure 1 The process of accessing OBS over intranet by using obsutil on a Linux ECS

Procedure

  1. Log In to the Linux ECS.

    1. Log in to HUAWEI CLOUD and click Console.
    2. On the home page of the console, choose Compute > Elastic Cloud Server.
    3. Select an ECS and log in to the ECS.

      The login mode varies according to the login authentication mode set during the Linux ECS purchase. For details about how to log in to the ECS, see Purchasing and Logging In to a Linux ECS.

  2. Check whether the intranet DNS is configured on the Linux ECS.

    1. Log in to the Linux ECS and open the CLI.
    2. Run the cat /etc/resolv.conf command to check whether the IP address after nameserver in the first line is the intranet DNS address of the region where the current ECS resides.

      HUAWEI CLOUD provides different intranet DNS server addresses for different regions. For details, see What Are the Private DNS Servers Provided by the HUAWEI CLOUD DNS Service?

      • If no, go to 3.
      • If yes, go to 5.

  3. Configure the Intranet DNS.

    Change the DNS server address of the ECS to the intranet DNS provided by HUAWEI CLOUD. To do this, you can change the DNS address of the VPC subnet or change the local DNS configuration.

    • Methods 1: Changing the DNS server address of the VPC subnet

      Locate the VPC where the ECS resides and change the DNS server address of the VPC subnet to the intranet DNS address. This way, ECSs in the VPC can use the intranet DNS for resolution and thereby you can access OBS over the HUAWEI CLOUD intranet. For details, see Modifying a Subnet.

      The intranet DNS server address must be selected based on the region where the ECS resides. For details, see What Are the Private DNS Servers Provided by the HUAWEI CLOUD DNS Service?

    • Method 2: Modifying the local DNS configuration

      The following uses an ECS running 64-bit CentOS 6.x as an example to describe how to modify the local DNS configuration.

      1. Open the CLI.
      2. Run the following command to open the /etc/resolv.conf file:
        vi /etc/resolv.conf
      3. Press i to enter the editing mode. In the /etc/resolv.conf file, add the intranet DNS server address before the existing DNS server address in the following format:
        nameserver Intranet DNS server address
        • Intranet DNS server address: Select the intranet DNS server address based on the region where the ECS resides. For details, see What Are the Private DNS Servers Provided by the HUAWEI CLOUD DNS Service?
        • The IP address of the new DNS server must come before all existing DNS IP addresses.
        • DNS servers are selected in the sequence of nameserver. A new DNS server is selected only when the previous DNS server is faulty, unavailable, or cannot resolve the requested domain name. Therefore, if you want to switch to the public network access mode, you need to change the first line of the DNS address to a public DNS server address or add a public DNS server address before the existing DNS server address.
      4. Press ESC and enter :wq! to save the settings and close the file.

        The modified DNS server address takes effect immediately after you save the modification to the /etc/resolv.conf file.

  4. Check whether OBS is accessed through the intranet.

    For details, see How Do I Determine Whether OBS Is Accessed from the Intranet?

  5. Download obsutil.

    For details about the latest version of obsutil and download link, see Download and Installation.

  6. Configure obsutil.

    Before using, you need to configure the interconnection between obsutil and OBS. Parameters include OBS endpoints and access keys (AK and SK). For details, see Performing Initial Configuration in the obsutil tool guide.

    The OBS endpoint needs to be entered according to the region where the ECS resides. For details about OBS regions and endpoints, see Regions and Endpoints.

  7. Use obsutil.

    After obsutil is successfully configured, you can access OBS over HUAWEI CLOUD intranet on the Linux ECS to perform basic data access operations and other advanced settings.

    For details, see the following topics:

    For details about operations, see Introduction to obsutil.

close