Help Center> FunctionGraph> FAQs> General FAQs> How Do I Obtain the Source IP Address of an HTTP Request Initiated by a Function?
Updated on 2024-05-23 GMT+08:00

How Do I Obtain the Source IP Address of an HTTP Request Initiated by a Function?

Public Access

  • VPC Access disabled for the function

    The SNAT address of FunctionGraph is used to access the public network. It is fixed. To obtain it, contact technical support.

    Figure 1 VPC access disabled
  • VPC Access enabled for the function (For details about the VPC configuration, see Configuring Networks)
    Figure 2 VPC access enabled

    The SNAT address configured in the user VPC is used to access the public network. It is fixed. To obtain the public IP address, perform the following steps:

    1. Log in to the NAT Gateway console, click in the upper left corner, and select a region.
    2. In the navigation pane on the left, choose NAT Gateway > Public NAT Gateway. In the list on the right, click the target gateway name.
    3. On the SNAT Rules tab, obtain the public IP address in the rule list.
      Figure 3 Obtaining the public IP address

Intra-VPC Access

When VPC Access is enabled, functions can access resources in a VPC. (For details about the VPC configuration, see Configuring Networks)

The user VPC address mounted in the PAT is used to access resources in the VPC. The address changes dynamically. To view the private IP address, perform the following steps:

  1. Log in to the VPC console, click in the upper left corner, and select a region.
  2. In the navigation pane on the left, choose Virtual Private Cloud > Network Interfaces. On the displayed page on the right, obtain the private IP address whose name is FunctionGraph-Access-VPC-Port and Type is Extended network interface. For details about elastic network interfaces, see Elastic Network Interface.
    Figure 4 Obtaining the private IP address
    • When configuring the whitelist or inbound/outbound rules of a security group, ensure that the configured IP address is within the VPC CIDR block. For details about how to create a security group, see Creating a Security Group.
    • Make sure to test the VPC function to display the Extended network interface in the Type column.
    • The two private IP addresses obtained above are the active and standby addresses. For details, contact technical support.

General FAQs FAQs

more