Building a CLB WAF Test Environment

Last Updated At: 2025-11-13 14:45:28

Creating a CVM

  1. Log in to the tenant side, enter the CVM page, select the corresponding region, and click Create.
  2. Select the network consistent with the CLB network, select other options according to the actual situation, and click Next: Select Image.
  3. After selecting the image according to the actual situation, click Next: Select Storage and Bandwidth.
  4. After selecting the storage and bandwidth according to the actual situation, click Next: Set Security Group and Host.
  5. After selecting the security group and host according to the actual situation, enter the host password and click Next: Confirm Configuration Information.
  6. Check the information you just selected. After confirming that everything is correct, click Enable.

Applying for an EIP and Binding It to the CVM

  1. Under the CVM menu, click Elastic IP, select the same region as the CVM region, and click Apply. Then select options according to the actual situation.
  2. Click Confirm to return to the Elastic IP List page, and you can see that the created elastic IP address is displayed as Unbound.
  3. Click the Operation column on the Elastic IP page, click More, and select Bind.
  4. Select the CVM you want to bind and click Confirm.
  5. Check the information that needs to be confirmed. After confirming that everything is correct, click Confirm.
  6. Go to the Elastic IP List page. You can see that the created EIP address is displayed as Bound.

Installing Nginx and Enabling Port 80

  1. Click the CVM ID. On the CVM parameter page, copy the server ID of the CVM.

  2. Enter CVM on the operation side, choose VM Management > Tenant-Side Resources, select UUID in the search box, and then paste the server ID you just copied to find the private IP address of the host.

  3. Log in to the private IP address of the host and enter the command: ssh host private IP address. The password is the one entered when you activated CVM.

  4. Enter the virsh console UUID --force command. For example, enter the virsh console 5abe1b63-67e9-4fa3-bcf8-10e208bd0c11 --force command to enter CVM.

  5. After entering CVM, enter the following command to perform an installation:
    Install: <1>yum install -y nginx
    Start the Nginx service: service nginx start.
    Check whether port 80 is enabled: netstat -nap|grep 80.

Forwarding Ports Using NAT Gateway (If Required)

  1. Under the VPC menu, select NAT Gateway. After selecting the corresponding region, click Create to create a NAT gateway.
  2. Enter information according to the actual situation and click Create to return to the NAT Gateway List page.
  3. In the created NAT gateway, click the gateway ID.
  4. Click Port Forwarding.
  5. Click Create.
  6. Add a port to be forwarded.
  7. Under VPC, select Route Table. Under the corresponding region, click Create to create a route table.
  8. Enter information and click Create. Select the policy as the added NAT gateway.
  9. A prompt indicates that you need to associate a subnet. After selecting the associated subnet, click OK to return to the Route Table List page.

Visiting http:// Public IP Address:788/ to Verify Whether the Website Is Normal

Adding a CLB Instance and Listener

  1. Click CLB. On the LB Instance List page, click Create.

  2. Enter information according to the actual situation. The CLB should be consistent with that of the CVM network. Then click Confirm Activation.

  3. On the Purchase Confirmation page, click Confirm.

  4. Click Finish.

  5. On the LB Instance List page, view the instance you just created and click the instance ID.

  6. Click Listener Management.

  7. Click Create or Start Creation to create a listener.

  8. Enter the name, protocol, and port number. Enter the port number forwarded through the NAT gateway, such as 788. Then click OK.

  9. Click Start Creation under the listener and enter the domain name to be configured. For subsequent steps, see "Binding HTTP Listeners in CLB Instance" in the "Functional Test Case (CLB) Tenant Side" documentation.

Adding Engine Nodes for CLB WAF

  1. Log in to the operation side. In Virtual Machine Management > Operation-side Resource in the CVM, allocate engine node IP addresses after submitting a request to the environment administrator.
  2. Log in to the WAF operation side and click Add in Cluster Management.
  3. Enter the engine IP addresses, use ";" to separate them, and click Confirm.
  4. The IP addresses are added successfully.