Connect an IoT device to IoT Platform

更新时间:
复制 MD 格式

This topic describes how to use Cloud Connector (CC) to connect an Internet of Things (IoT) device to IoT Platform. You can use CC to secure data transmission and accelerate access to IoT Platform.

Prerequisites

Background information

The following scenario is used as an example. You want to connect an IoT device to IoT Platform in an efficient manner while ensuring the security and stability of data transmission. You can use CC to create a secure and reliable connection between the IoT device and IoT Platform. Architecture

Procedure

Access OSS

Step 1: Create a CC instance

Before you can use CC to connect your IoT devices to IoT Platform, you must create a CC instance and specify a dedicated Access Point Name (APN), a virtual private cloud (VPC), and vSwitches.

  1. Log on to the Cloud Connector console.
  2. In the top navigation bar, select the region for the Cloud Connector instance.
  3. On the Instance List page, click Create Instance.
  4. On the Create Instance page, set the following parameters and click Complete.
    ParameterDescription
    Basic Information
    RegionThe region where the Cloud Connector instance will be created.
    NameEnter a name for the Cloud Connector instance.
    CarrierThe carrier of the dedicated APN.

    After you select an APN, the system automatically populates this field.

    APNThe dedicated APN for network access.

    IoT endpoints use this APN to connect privately to Alibaba Cloud services.

    Network Settings
    VPCSelect an existing VPC.

    IoT endpoints can connect directly to this VPC.

    vSwitchSelect existing vSwitches.

    You must select two vSwitches in different availability zones to serve as the primary and secondary vSwitches.

    Note
    • After a Cloud Connector instance is created, its carrier and APN cannot be changed.
    • When you create a Cloud Connector instance, the system checks whether the AliyunServiceRoleForCCIoT and AliyunServiceRoleForNatgw service-linked roles exist. If these roles do not exist, the system automatically creates them. For more information, see AliyunServiceRoleForCCIoT and AliyunServiceRoleForNatgw.

Step 2: Associate the IP address of the IoT device with the CC instance

To enable an IoT device to access IoT Platform, you must associate the IP address of the IoT device with the CC instance. Make sure that the IP address meets the following requirements:

  • The IP addresses must be valid and belong to the dedicated APN associated with the Cloud Connector instance.
  • The IP addresses must not be used by another Cloud Connector instance.
  1. Log on to the Cloud Connector Management Console.

  2. On the Instances page, find the target Cloud Connector instance and, in the Actions column, click Add IP.

  3. On the IP management tab, click Download template. Add the IP addresses to the downloaded template file and save it.

  4. On the IP management tab, click Add IP.

  5. In the Add IP dialog box, click Select file and select the file that you saved in step 3. After the file is uploaded, click OK.

    Note

    The file to be uploaded must be in CSV format.

Step 3: Configure an authorization rule

Before the IoT device can access IoT Platform, you must configure an authorization rule on the CC instance. Set the destination to the elastic IP address (EIP) or the private domain name of IoT Platform

  1. Log on to the Cloud Connector console.
  2. On the Instances page, find the target Cloud Connector instance, and in the Actions column, click Configure Authorization Rules.

  3. On the Authorization Rules tab, click Add Rule.

  4. In the Add Rule dialog box, set the following parameters and click OK.

    Parameter

    Description

    Rule name

    Enter a name for the authorization rule.

    Destination

    Enter the destination.

    1. Select a destination type. Valid values: Domain Name and CIDR Block. In this example, Domain Name is selected.

    2. Enter a domain name, an IP address, or a CIDR block based on the specified destination type. In this example, the domain name IoT Platform is used.

    Protection Action

    Select an action. In this example, Allow is selected.

Step 4: Test the network connectivity

  1. Configure the IoT card on the IoT device.

  2. Run the ping command to test the connectivity between the IoT device and IoT Platform. If you can receive echo reply packets, the connection is established.

     ping <The private domain name of IoT Platform>
Note

The test method varies based on the IoT device. For more information, see the user guide of your IoT device.