Typical Scenarios


IPv4+IPv6 Dual Stack

An IPv4+IPv6 dual stack is one NIC with two types of IP addresses: IPv4 and IPv6, and takes full advantage of both IPv4 and IPv6. With the IPv4+IPv6 dual stack, you can meet the needs of different business scenarios.

The following tables list the assumed environment configurations.
  1. IPv4 Network Range
    Table 1. IPv4 Network Configuration
    Flat Network Configurations
    NIC em1
    VLAN ID 2002
    IP Range 192.168.2.2-192.168.2.254
    Netmask 255.255.255.0
    Gateway 192.168.2.1
    DHCP IP 192.168.2.3
    DNS 223.5.5.5
  2. IPv6 Network Range
    Table 2. IPv6 Network Configuration
    Flat Network Configurations
    IP Range 234e:0:4568::2-234e:0:4568:0:ffff:ffff:ffff:ffff
    Prefix Length 64
    Gateway 234e:0:4568::1
    DHCP IP 234e:0:4567::3
    DNS 240c::6644
To create an IPv4+IPv6 dual stack, follow these steps:
  1. Create an IPv4 networking environment.
  2. Add an IPv6 range.
  3. Add an IPv6 DNS address.
  4. Create VM instances by using the dual-stack network.
  5. Obtain IPv6 addresses of the VM instances.
  6. Validate the network connectivity.
  1. Create an IPv4 networking environment.
    Create a flat network with an IPv4 address, for example, L3-Flat Network. At this time, this network is an IPv4 network. For network configuration information, see IPv4 Network Configuration and IPv6 Network Configuration.
    Note: You can also create an IPv6 flat network first, and then add an IPv4 range to a flat network.
  2. Add an IPv6 range.

    Add an IPv6 range to the existing IPv4 network to form an IPv4+IPv6 dual-stack network.

    On the Flat Network page, locate the IPv4 network and click Actions > Add IPv6 Range. On the displayed Add Network Range page, set the following parameters:
    • Network Range Method: Select a method to add a network range for the VPC network. You can select IP Range or CIDR. Here, select IP Range.
    • IP Configuration Mode: Select Stateful-DHCP.
      Note:
      • Stateful-DHCP: The interface address and other parameters are all configured through DHCP. The IP range method supports stateful DHCP.
      • Stateless-DHCP: The interface address is automatically derived from the route advertisement prefix and the interface Mac address. Other parameters are configured through DHCP.
      • SLAAC: The interface address is automatically derived from the prefix of the route advertisement that also contains other parameters.
    • Start IP: Set a start IP address for the network range, for example, 234e:0:4568::2.
    • End IP: Set an end IP address for the network range, for example, 234e:0:4568:0:ffff:ffff:ffff:ffff.
    • Prefix Length: Set a prefix length for the network range, for example, 64. Range: 64-126.
    • Gateway: Set a gateway for the network range, for example, 234e:0:4568::1.
    • DHCP IP: Optional. Set an IP address for the DHCP server, for example, 234e:0:4568::3.
      Note:
      • When you create an L3 network and enable the DHCP service for the first time, or when you add the first network range for an L3 network that has the DHCP service enabled, you can specify an IP address for the DHCP server.
      • If a DHCP IP is specified for an L3 network, you cannot specify another DHCP IP when you add a network range for the network.
      • The DHCP IP can be within or out of the added IP range. However, the IP address must be within the CIDR block to which the added IP range belongs and must not be in use.
      • The IP range determined by the start IP and end IP cannot contain the link-local address fe80::/10.
      • If not specified, the system would randomly specify a DHCP IP within the added IP range for the DHCP server.
    Figure 1. Add IPv6 Range


  3. Add an IPv6 DNS address.
    On the DNS tab page of the flat network, click Add DNS. On the Add DNS dialogue box, set the following parameters:
    • Network Address Type: Select IPv6.
    • DNS: Specify a DNS address, for example, 240c::6644.
    Figure 2. Add IPv6 DNS Address


  4. Create VM instances by using the dual-stack network.

    On the main menu of ZStack Cloud, choose Resource Center > Resource Pool > Virtual Resource > VM Instance. On the VM Instance page, click Create VM Instance. Then, the Create VM Instance page is displayed. On the displayed page, create two VM instances by using the IPv4 flat network, for example, VM-Dual Stack-1 and VM-Dual Stack-2.

  5. Obtain IPv6 addresses of the VM instances.
    By default, ZStack Cloud can automatically obtain IP addresses for the IPv4 network, while you must manually configure IP addresses for VM instances that use the IPv6 network. Launch the consoles of these two VM instances respectively, and run the following commands to obtain IPv6 addresses:
    [root@loaclhost~]# dhclient -6 eth0  //eth0 indicates the NIC name.
    Note: The address that begins with FE80 is the link-local address instead of the expected address.
    Figure 3. Obtain IP Address


    In this scenario, after running ifconfig, you will obtain the following addresses:
    • VM-Dual Stack-1 IPv4 address: 192.168.2.248
    • VM-Dual Stack-1 IPv6 address: 234e:0:4568::69:9fdc
    • VM-Dual Stack-2 IPv4 address: 192.168.2.183
    • VM-Dual Stack-2 IPv6 address: 234e:0:4568::23:c59b
  6. Validate the network connectivity.
    Expected result:
    • Log in to the VM-Dual Stack-1. Use the IPv4 address and the IPv6 address respectively to validate whether these two IP addresses can ping VM-Dual Stack-2.
    • Log in to the VM-Dual Stack-2. Use the IPv4 address and the IPv6 address respectively to validate whether these two IP addresses can ping VM-Dual Stack-1.
    Figure 4. Validate Network Connectivity


    Similarly, log in to the VM-Dual Stack-2. Use the IPv4 address and the IPv6 address to validate whether these two IP addresses ping VM-Dual Stack-1.

    So far, we have introduced how to use a Dual stack (IPv4+IPv6) flat network.


Load Balancing

Typical scenario: Assume that the user has a high number of application access in the VPC network. The user wants to use a dedicated performance load balancer to distribute traffic flows to a group of backend servers to improve the service capbility of the business. According to the business needs, the load balancer needs to adopt a HTTPS protocol to monitor traffic flows. Assume the user has met the following requirements:
  • The user has deployed the latest version of ZStack Cloud.
  • The user has deployed a public network, VPC network, and management network.
  • The user has created 3 business VMs.
To create a private flat network load balancing, follow these steps:
  1. Add a dedicated-performance LB image.
  2. Create a load balancer instance offering.
  3. Create a dedicated-performance load balancer.
  4. Create a listener.
  5. Add a backend server and assign a weighted value.
  6. Validate the scenario.
  1. Add a dedicated-performance LB image.

    On the main menu of ZStack Cloud, choose Resource Center > Network Service > Basic Network Service > Load Balancing > Image. On the Image tab, click Add Image. The Add Image page appears.

    On the displayed page, set the following parameters:
    • Name: Enter a name for the LB image.
    • Description: Optional. Enter a description for the LB image.
    • CPU Architecture: Select a CPU architecture for the LB image. LB instances created from the image inherit this CPU architecture.
    • Backup Storage: Select a backup storage to store the LB image.
    • Image Path: Enter a URL or upload a local file. In this case, enter a URL.
      • URL: Enter the download URL of the LB image.
        ZStack Cloud provides you with dedicated-performance LB images (KVM). You can download the latest images from the official website.
        • Software: ZStack-SLB-5.2.0.qcow2
        • Download address: Click here
    Figure 1. Add Dedicated-Performance LB Image


  2. Create a load balancer instance offering.

    On the main menu of ZStack Cloud, choose Resource Center > Network Service > Basic Network Service > Load Balancing > Offering. On the Offering tab, click Create Load Balancer Instance Offering. The Create Load Balancer Instance Offering page is displayed.

    On the displayed page, set the following parameters:
    • Zone: By default, the current zone is displayed.
    • Name: Enter a name for the load balancer (LB) instance offering.
    • Description: Optional. Enter a description for the LB instance offering.
    • CPU: Specify the number of CPU cores for the LB instance offering, for example, specify 2 Core.
    • Memory: Specify the memory size for the LB instance offering, for example, specify 8GB.
    • Image: Select a dedicated-performance LB image that you added.
    • Management Network: Select a management network that you created.
    Figure 2. Create Load Balancer Instance Offering


  3. Create a dedicated-performance load balancer.

    On the main menu of ZStack Cloud, choose Resource Center > Network Service > Basic Network Service > Load Balancing. On the Load Balancer page, click Create Load Balancer. The Create Load Balancer page appears.

    On the displayed page, set the following parameters:
    • Name: Enter a name for the LB.
    • Description: Optional. Enter a description for the LB.
    • LB Type: Select Dedicated Performance.
    • Network: Select a network as the frontend network of the LB. Here, select a flat network.
    • VIP: You can create a VIP or use an existing VIP to provide load balancing services. Here, select New VIP. Set the following parameters:
      • Network Range: Optional. Select an IP range.
      • Assign IP: Optional. Specify a VIP. This parameter is available only after you select an IP range.
    • Backend Network: Select a network as the backend network. Here, specify the same flat network.
    • LB Instance Name: Enter a name for the LB instance.
    • Load Balancer Offering: Select a LB offering.
    Figure 3. Create Dedicated-Performance Load Balancer


  4. Create a listener.

    On the details page of the load balancer, click the Listener tab. On the tab, click Create Listener. The Create Listener page is displayed.

    On the displayed page, set the following parameters:
    • Name: Enter a name for the listener.
    • Description: Optional. Enter a description for the listener.
    • Protocol: Select a listening protocol. Here, select TCP.
    • Load Balancer Port: Specify a port for load balancing. Valid values: 1 to 65535. Here, specify100.
    • Backend Server Port: Specify a backend server port. Valid values: 1 to 65535. Here, specify 80.
    • Load Balancer Algorithm: Set a routing rule for data packets. Here, select Weighted Round Robin.
    • Session Persistence: An innate mechanism of the load balancing service. It identifies the association of the interactions between a client and backend servers based on which a load balancer can direct the client's requests to a specific backend server and achieve business continuity.
    • Backend Server Group: Optional. Select a backend server group. Here, select the default backend server group.
    • Advanced: Configure advanced settings for the listener. Here, use default settings.
    Figure 4. Create Listener


  5. Add a backend server and assign a weighted value.
    1. Add a backend server.

      On the details page of the load balancer, click Backend Server Group. On the tab, enter the details page of the backend server group. On the details page, click Add Backend Server. Then, the Add Backend Server page is displayed.

      On the displayed page, set the following parameters:
      • Backend Server: You can add a VM instance or other servers outside of the Cloud as a backend server. Here, select By Instance NIC.
      • Network: By default, the flat network is displayed.
      • NIC: Specify 3 VM instances NICs.
      Figure 5. Add Backend Server


    2. Assign a weighted value.

      On the Add Backend Server page, assign a weighted value to the 3 VM instances respectively. Requests are more likely to be distributed to VM instances with a higher weight.

      Figure 6. Assign Weighted Value


  6. Validate the scenario.

    In this scenario, we will run the curl command in the port 100 of the VIP address (192.168.0.249) of the load balancer: for i in {1..20}; do curl 192.168.0.249:100; done.

    Expected result:
    • VM-1 (Weighted value: 80): The number (probability) of distributed requests is relatively high.
    • VM-2 (Weighted value: 40): The number (probability) of distributed requests is relatively medium.
    • VM-3 (Weighted value: 20): The number (probability) of distributed requests is relatively low.
    Actual result:
    • VM-1: being polled for 11 times.
    • VM-2: being polled for 6 times.
    • VM-3: being polled for 3 times.
    Figure 7. Scenario Validation


    So far, we have introduced how to use the load balancing service based on a flat network.

Archives

Download Document Archives

Back to Top

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.
同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.