Multiple-IP instance family

Updated at:

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.

    root@iZbp148rxxxxx9brZ:~# ifconfig
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 172.26.32.207  netmask 255.255.192.0  broadcast 172.26.63.255
            inet6 fexxx  eff:fe3d:5baa  prefixlen 64  scopeid 0x20<link>
            ether 00:xxx:55:aa  txqueuelen 1000  (Ethernet)
            RX packets 619  bytes 129149 (129.1 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 756  bytes 85244 (85.2 KB)
            TX errors 0  dropped 0  overruns 0  carrier 0  collisions 0
    
    eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 172.26.32.208  netmask 255.255.192.0  broadcast 172.26.63.255
            inet6 fexxx  3eff:fe3d:5cc5  prefixlen 64  scopeid 0x20<link>
            ether 00 xxx d:5c:c5  txqueuelen 1000  (Ethernet)
            RX packets 117  bytes 16198 (16.1 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 125  bytes 10002 (10.0 KB)
            TX errors 0  dropped 0  overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 316  bytes 29907 (29.9 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 316  bytes 29907 (29.9 KB)
            TX errors 0  dropped 0  overruns 0  carrier 0  collisions 0
    
    root@iZbp148rvxxxxxbrZ:~# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         172.26.63.253   0.0.0.0         UG    100    0        0 eth0
    0.0.0.0         172.26.63.253   0.0.0.0         UG    100    0        0 eth1
    100.100.2.136   172.26.63.253   255.255.255.255 UGH   100    0        0 eth0
    • 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.

    root@iZbp148xxxq0brZ:~# ifconfig
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 172.26.32.208  netmask 255.255.192.0  broadcast 172.26.63.255
            inet6 fexxx  xxx:fe3d:55aa  prefixlen 64  scopeid 0x20<link>
            ether 00:xxx  xxx:5a:aa  txqueuelen 1000  (Ethernet)
            RX packets 128478  bytes 189859634 (189.8 MB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 5730  bytes 472293 (472.2 KB)
            TX errors 0  dropped 0  overruns 0  carrier 0  collisions 0
    
    eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 172.26.32.207  netmask 255.255.192.0  broadcast 172.26.63.255
            inet6 fexxx  3eff:fe3d:5cc5  prefixlen 64  scopeid 0x20<link>
            ether 00:xxx  d:5c:c5  txqueuelen 1000  (Ethernet)
            RX packets 1397  bytes 133366 (133.3 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 1337  bytes 84975 (84.9 KB)
            TX errors 0  dropped 0  overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 4457  bytes 302982 (302.9 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 4457  bytes 302982 (302.9 KB)
            TX errors 0  dropped 0  overruns 0  carrier 0  collisions 0

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.

  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.

      root@iZbp148rvyxxx_q0brZ:~# tcpdump -i eth0 icmp
      tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
      listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
      15:01:16.834806 IP 124.xxx > iZbp148rvyxxx q0brZ: ICMP echo request, id 1, seq 52477, length 40
      15:01:16.834869 IP iZbpxxx 2eittq0brZ > 12xxx.166: ICMP echo reply, id 1, seq 52477, length 40
      15:01:17.837805 IP 124.xxx > iZbp148rvyxxx q0brZ: ICMP echo request, id 1, seq 48910, length 40
      15:01:17.837840 IP iZbpxxx 2eittq0brZ > 12xxx.166: ICMP echo reply, id 1, seq 48910, length 40
      15:01:18.840947 IP xxx > iZbp148rvyxxx q0brZ: ICMP echo request, id 1, seq 43647, length 40
      15:01:18.840993 IP iZbpxxx 2eittq0brZ > 12xxx.166: ICMP echo reply, id 1, seq 43647, length 40
      15:01:19.845808 IP 124.xxx > iZbp148rvyxxx q0brZ: ICMP echo request, id 1, seq 61273, length 40
      15:01:19.845843 IP iZbpxxx 2eittq0brZ > 12xxx.166: ICMP echo reply, id 1, seq 61273, length 40

    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.

      17:19:40.131951 IP 14xxx > iZ2ze4so5eiwlxxx: ICMP echo request, id 6567, seq 380, length 64
      17:19:40.131990 IP iZxxx.wh56       > 1xxx.8: ICMP echo reply, id 6567, seq 380, length 64
      17:19:41.138997 IP 14xxx > iZ2ze4so5eiwlxxx: ICMP echo request, id 6567, seq 381, length 64
      17:19:41.139021 IP iZxxx.wh56       > 1xxx.8: ICMP echo reply, id 6567, seq 381, length 64
      17:19:42.137495 IP 14xxx > iZ2ze4so5eiwlxxx: ICMP echo request, id 6567, seq 382, length 64
      17:19:42.137519 IP iZxxx.wh56       > 1xxx.8: ICMP echo reply, id 6567, seq 382, length 64