DaaS / Products / Deploy and Network-Configure ECS Server

Deploy and Network-Configure ECS Server

A developer provisions a new Alibaba Cloud Linux ECS instance for an application server and immediately configures its networking — assigning security group rules, binding an elastic network interface, and setting up public IP access so the instance is reachable and secure.

Products involved

Scenario

Developers use this workflow when deploying a new Alibaba Cloud Linux (Alinux) application server that requires immediate, secure external access. By combining ECS instance provisioning with granular network configuration, teams ensure the server boots with hardened security group rules, a dedicated secondary ENI for traffic isolation, and a public EIP for inbound reachability.

Integration steps

  1. Provision Alinux Instance: Launch the instance using the official Alinux 3 image.
  2. ``bash aliyun ecs RunInstances --RegionId cn-hangzhou --InstanceType ecs.g7.large \ --ImageId aliyun_3_x64_20G_alibase_20230801.vhd --VSwitchId vsw-xxx \ --SecurityGroupId sg-default --InstanceName alinux-app-01 ``

  3. Create & Authorize Security Group: Define inbound rules for application traffic.
  4. ``bash aliyun ecs CreateSecurityGroup --RegionId cn-hangzhou --VpcId vpc-xxx --SecurityGroupName app-sg aliyun ecs AuthorizeSecurityGroup --SecurityGroupId sg-xxx --IpProtocol TCP --PortRange 8080/8080 --SourceCidrIp 0.0.0.0/0 ``

  5. Attach Security Group: Bind the hardened SG to the running instance.
  6. ``bash aliyun ecs JoinSecurityGroup --SecurityGroupId sg-xxx --InstanceId i-xxx ``

  7. Create & Attach Secondary ENI: Provision a dedicated ENI in the same VSwitch.
  8. ``bash aliyun ecs CreateNetworkInterface --RegionId cn-hangzhou --VSwitchId vsw-xxx --SecurityGroupId sg-xxx aliyun ecs AttachNetworkInterface --InstanceId i-xxx --NetworkInterfaceId eni-xxx ``

  9. Allocate & Bind EIP: Assign a public IP for external reachability.
  10. ``bash aliyun vpc AllocateEipAddress --RegionId cn-hangzhou --InstanceChargeType PostPaid aliyun vpc AssociateEipAddress --AllocationId eip-xxx --InstanceId i-xxx --InstanceType EcsInstance ``

  11. Configure Alinux Network Stack: SSH in and activate the secondary interface.
  12. ``bash nmcli con add type ethernet ifname eth1 con-name eni-secondary nmcli con up eni-secondary ``

  13. Apply Alinux Network Tuning: Optimize kernel TCP parameters for high-throughput workloads.
  14. ``bash echo "net.core.rmem_max = 16777216" >> /etc/sysctl.conf sysctl -p ``

Architecture

The ECS control plane orchestrates infrastructure provisioning (compute allocation, VPC routing, EIP binding, and hypervisor-level ENI attachment). Once virtual NICs are attached at the hypervisor layer, the Alinux guest OS assumes control, using NetworkManager for IP routing, firewalld for host-level packet filtering, and sysctl for kernel TCP stack tuning. API requests flow from the CLI → Alibaba Cloud API Gateway → ECS/VPC controllers → Guest OS via cloud-init and virtio-net drivers.

Prerequisites

Common pitfalls

Typical questions