Multiple-IP instance family

更新时间:
复制 MD 格式

Instances in the multiple-IP instance family let you configure a separate public IP address for each website or application. This setup enhances network performance and security. These instances are ideal for use cases such as managing security for e-commerce, gaming, and short video accounts, as well as for game acceleration. This document describes the limitations and default network and routing configurations for these instances, and provides guidance on how to modify them.

Limitations

  • The multiple-IP instance family is supported only on instances created from the following images and custom images based on them: Ubuntu 24.04, CentOS 7.6, Alibaba Cloud Linux 3, and BT-Panel Alibaba Cloud Exclusive Edition.

  • You cannot reset the system of a multiple-IP instance with a custom image.

  • A multiple-IP instance family plan has a peak bandwidth of 200 Mbps, shared across its static public IP addresses:

    • If Fixed Public IP Address is 2 IPv4s: the peak bandwidth for each IP is 100 Mbps.

    • If Fixed Public IP Address is 3 IPv4 addresses: the peak bandwidth for each IP address is 67 Mbps.

Network configuration

Default network configuration

By default, a multiple-IP instance is created with two network interface cards (NICs), eth0 and eth1. Examples of the default network configuration files are shown below.

Ubuntu 24.04

The default network configuration file, /etc/netplan/50-cloud-init.yaml, is similar to the following examples:

  • Two IP addresses

    network:
        ethernets:
            eth0:
                dhcp4: true
                dhcp4-overrides:
                    route-metric: 100
                dhcp6: false
                match:
                    macaddress: 00:16:3e:08:XX:XX    # MAC address of eth0
                set-name: eth0
            eth1:
                dhcp4: true
                dhcp4-overrides:
                    route-metric: 200
                dhcp6: false
                match:
                    macaddress: 00:16:3e:08:XX:XX    # MAC address of eth1
                set-name: eth1
        version: 2
  • Three IP addresses

    network:
        ethernets:
            eth0:
                dhcp4: true
                dhcp6: false
                match:
                    macaddress: 00:16:3e:09:XX:XX  # MAC address of eth0
                set-name: eth0
                dhcp4-overrides:
                    route-metric: 100
            eth1:
                dhcp4: false
                dhcp4-overrides:
                    route-metric: 200
                dhcp6: false
                match:
                    macaddress: 00:16:3e:09:XX:XX   # MAC address of eth1
                set-name: eth1
                addresses:
                        - 172.26.32.200/18          # Private IP 1 on eth1
                        - 172.26.32.201/18          # Private IP 2 on eth1
                routes:
                  - to: default
                    via: 172.26.63.253    # Default gateway
        version: 2

CentOS 7.6, Alibaba Cloud Linux 3, and BT-Panel Alibaba Cloud Exclusive Edition

  • Two IP addresses

    • The default network configuration file /etc/sysconfig/network-scripts/ifcfg-eth0 is as follows:

      DEVICE=eth0
      BOOTPROTO=dhcp
      ONBOOT=yes
    • The default network configuration file /etc/sysconfig/network-scripts/ifcfg-eth1 is as follows:

      DEVICE=eth1
      BOOTPROTO=dhcp
      ONBOOT=yes
      TYPE=Ethernet
      HWADDR=00:16:3e:09:XX:XX   # MAC address
      DEFROUTE=no
  • Three IP addresses

    • The default network configuration file /etc/sysconfig/network-scripts/ifcfg-eth0 is as follows:

      DEVICE=eth0
      BOOTPROTO=dhcp
      ONBOOT=yes
    • The default network configuration file /etc/sysconfig/network-scripts/ifcfg-eth1 is as follows:

      DEVICE=eth1
      BOOTPROTO=dhcp
      ONBOOT=yes
      TYPE=Ethernet
      HWADDR=00:16:3e:09:XX:XX   #MAC address
      DEFROUTE=no
    • The default network configuration file /etc/sysconfig/network-scripts/ifcfg-eth1:1 is as follows:

      DEVICE=eth1:1
      TYPE=Ethernet
      BOOTPROTO=static
      ONBOOT=yes
      IPADDR=172.26.32.206    # private IP address
      NETMASK=255.255.192.0   # subnet mask

Modify the network configuration

If the default network configuration does not meet your needs, you can modify it. This example shows how to swap the private IP addresses on the eth0 and eth1 network interfaces for an Ubuntu 24.04 instance with two IP addresses.

  1. Connect to the multiple-IP instance. For instructions, see Connect to a Linux server.

  2. Run the following commands to view the subnet masks, the private IP addresses of the network interfaces, and the default gateway:

    ifconfig
    route -n

    In this example, the output is similar to the following.

    image

    • Network interface eth0

      • Private IP address (inet): 172.26.32.207

      • Subnet mask (netmask): 255.255.192.0

      • Default gateway (Gateway): 172.26.63.253

    • Network interface eth1

      • Private IP address (inet): 172.26.32.208

      • Subnet mask (netmask): 255.255.192.0

      • Default gateway (Gateway): 172.26.63.253

  3. Run the following command to modify the default network configuration file:

    sudo vim /etc/netplan/50-cloud-init.yaml
  4. Press i to enter edit mode and modify the network configuration.

    This example swaps the private IP addresses of the eth0 and eth1 network interfaces.

    network:
        ethernets:
            eth0:
                dhcp4: false    # Disable DHCP
                dhcp4-overrides:
                    route-metric: 100
                dhcp6: false
                match:
                    macaddress: 00:16:3e:08:XX:XX
                set-name: eth0
                addresses:
                        - 172.26.32.208/18          # Change the private IP on eth0 to the original IP of eth1           
            eth1:
                dhcp4: false    # Disable DHCP
                dhcp4-overrides:
                    route-metric: 200
                dhcp6: false
                match:
                    macaddress: 00:16:3e:08:XX:XX
                set-name: eth1
                addresses:
                        - 172.26.32.207/18          # Change the private IP on eth1 to the original IP of eth0
                routes:                             
                  - to: default
                    via: 172.26.63.253              # Configure the gateway on eth1
        version: 2
  5. Press Esc, enter :wq, and press Enter to save the file and exit.

  6. Run the following command to apply the configuration:

    sudo netplan apply
  7. Run the following command to verify that the new configuration is active:

    ifconfig

    The output is similar to the following, confirming that the private IP addresses on the eth0 and eth1 network interfaces have been swapped.

    image

Routing configuration

Each network interface on a multiple-IP instance has pre-configured routing rules to ensure that traffic enters and exits through the correct public IP address.

Default routing configuration

  • IP address on eth0: Both inbound and outbound traffic pass through eth0.

  • IP address on eth1: Both inbound and outbound traffic pass through eth1.

Verify the default routing configuration

This example shows how to verify the configuration on an Ubuntu 24.04 instance with two IP addresses:

  1. On the instance card, click the instance ID. On the Server Overview page of the Simple Application Server console, view the public IP address corresponding to each private IP address.

    image

  2. Monitor Internet Control Message Protocol (ICMP) packets on both the eth0 and eth1 network interfaces.

    eth0

    1. Connect to the multiple-IP instance. For instructions, see Connect to a Linux server.

    2. Run the following command to capture ICMP packets on the eth0 network interface:

      tcpdump -i eth0 icmp
    3. On your local computer that has internet access, run the following command to send packets to the multiple-IP instance by pinging the public IP address that corresponds to the private IP address on eth0:

      ping 39.XX.XX.103
    4. In the command-line window of the multiple-IP instance, view the packet information for the eth0 network interface.

      The output shows the packet entering through the eth0 interface and the reply being sent from the same eth0 interface. This confirms that all inbound and outbound traffic for the IP address on eth0 passes through eth0.

      image

    eth1

    1. Connect to the multiple-IP instance. For instructions, see Connect to a Linux server.

    2. Run the following command to capture ICMP packets on the eth1 network interface:

      tcpdump -i eth1 icmp
    3. On your local computer that has internet access, run the following command to send packets to the multiple-IP instance by pinging the public IP address that corresponds to the private IP address on eth1:

      ping 47.XX.XX.135
    4. In the command-line window of the multiple-IP instance, view the packet information.

      The output shows the packet entering through the eth1 interface and the reply being sent from the same eth1 interface. This confirms that all inbound and outbound traffic for the IP address on eth1 passes through eth1.image