Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Anti-DDoS Service/ Best Practices/ Best Practices of Advanced Anti-DDoS/ Using the TOA Module to Obtain the Actual Source IP Addresses of Requests

Using the TOA Module to Obtain the Actual Source IP Addresses of Requests

Updated on 2024-12-24 GMT+08:00

Application Scenarios

After a service is connected to AAD, the actual source IP address of the traffic forwarded by AAD is concealed once it reaches the server. The source IP address of the customer's service origin server becomes the back-to-origin IP address of AAD. The true source IP address can be retrieved from the tcp option field in the TCP packet. IPv6 source IP addresses can be obtained.

During service application development, it is necessary to obtain the client's real IP address. Taking the voting system as an example, the real IP addresses of clients used for casting votes needs to be obtained to ensure that each client casts only one vote.

This topic describes how to use the TOA module provided by AAD to obtain the real source IP address.

Architecture

Generally, AAD changes the source IP address and destination IP address of the traffic passing through (respectively from the client's source IP address into the high-defense IP address and from the back-to-origin IP address into the origin server IP address). The source IP address visible to the user on the origin server is the back-to-origin IP address.

Figure 1 Mechanism
  • The high-defense IP address is provided by HUAWEI CLOUD to replace the IP address of the origin server to ensure its stability and reliability.
  • From the perspective of an origin server, all traffic originates from the back-to-origin IP address.
  • The origin server IP address is the public IP address used to provide services.

Limitations and Constraints

If the origin server runs one of the following Linux OSs, you can use the TOA module provided by AAD to obtain the real source IP address of the traffic forwarded by AAD.
  • CentOS 6.5 (corresponding to the Linux kernel version 2.6.X)
  • CentOS 7 (corresponding to the Linux kernel version 3.10.X)
  • toa_common (TOA of common version, which is applicable to OSs whose Linux kernel version is 3.0 or later, such as Ubuntu 14/16 and SUSE 11/42)
  • toa_linux-2.6.32-220.23.1.el6.x86_64.rs (corresponding to linux-2.6.32-220.23.1.el6.x86_64.rs)
NOTICE:
  • In the "AAD+web origin server" scenario, if basic web protection is disabled on AAD, you need to install TOA on the origin server to obtain the real source IP address.
  • If basic web protection is enabled for AAD or Huawei Cloud WAF is configured as the origin server, you do not need to install TOA to obtain the real source IP address. You can obtain the real source IP address from the Layer 7 request headers such as xff and x-real. Only the real IPv4 access source can be obtained. Obtain the Layer 7 HTTP real source IP addresses by referring to Obtaining the Real Client IP Addresses.
  • If the origin server runs other operating systems (such as Ubuntu and SUSE), follow the instructions described in Configuring the TOA Plug-in to customize and install the TOA plug-in to obtain the real source IP address.

Procedure

  1. Compile and install the TOA module by referring to the open-source code of TOA.

    NOTE:

    When the kernel module is mounted, you can obtain the real source IP address easily without modifying the existing server processes or interrupting existing services.

  2. Verify the module.

    You can obtain the real source IP address by referring to Configuring the TOA Plug-in or the following example code.

    >>print(newServerSocket.getpeername())
    >>"('cip',cport)"

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback