Accessing OBS over Intranet by Using obsutil on a Linux ECS
obsutil is a command line tool that can run Windows, macOS, and Linux operating systems. This section describes how to configure an intranet DNS server for a Huawei Cloud Linux ECS to access OBS over the intranet.
You need to download obsutil over the Internet. Alternatively, you can download obsutil from a cloud server that can access the Internet and then transfer the downloaded obsutil to the current cloud server for installation.
Process
Procedure
- Log In to the Linux ECS.
- Log in to the Huawei Cloud official website and click Console.
- On the home page of the console, choose Compute > Elastic Cloud Server.
- Select an ECS and log in to it.
The login mode is set during the Linux ECS creation.
For details about how to log in to the ECS, see Logging In to an ECS.
- Check whether the intranet DNS is configured on the Linux ECS.
- Log in to the Linux ECS and open the CLI.
- 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 private DNS server addresses for different regions. For details, see What Are the Private DNS Server Addresses Provided by Huawei Cloud?
- Configure the Intranet DNS.
Change the DNS server address of the ECS to the intranet DNS provided by Huawei CloudDNS. 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. In this manner, ECSs in the VPC can use the intranet DNS for resolution and thereby you can access OBS on 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 Server Addresses Provided by Huawei Cloud?
- Method 2: Modifying the local DNS configuration
The following uses an ECS running CentOS 6.x 64bit as an example to describe how to modify the local DNS configuration.
- Open the CLI.
- Run the following command to open the /etc/resolv.conf file:
vi /etc/resolv.conf
- Press i to enter insert 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
- The intranet DNS server address must be selected based on the region where the ECS resides. For details, see What Are the Private DNS Server Addresses Provided by Huawei Cloud?
- The IP address of the new DNS server must be placed 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. 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.
- 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.
- Methods 1: Changing the DNS server address of the VPC subnet
- Check whether OBS is accessed over the intranet.
For details, see How Do I Determine Whether OBS Is Being Accessed from an Intranet Connection?
- Download obsutil.
For details about the latest version of obsutil and download link, see Downloading obsutil.
- Configure obsutil.
Before using obsutil, you need to configure the interconnection between obsutil and OBS. Parameters include OBS endpoints and access keys (AK and SK).
For details, see Initializing Configurations in the tool guide of obsutil.
The OBS endpoint needs to be entered according to the region where the ECS resides.
- 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, see OBS Tools Guide (obsutil).
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.