DaaS / Products / Deploy and Debug Alinux ECS with Networking

Deploy and Debug Alinux ECS with Networking

Launch an Alibaba Cloud Linux ECS instance, configure its networking (ENI, security groups, public IP), tune kernel parameters for performance, and troubleshoot any OS-level or connectivity issues that arise during setup.

Products involved

Scenario

Developers use this workflow when provisioning high-performance Alibaba Cloud Linux (Alinux) workloads that require fine-grained network control, such as low-latency microservices or data processing nodes. It combines infrastructure provisioning, OS-level kernel tuning, and systematic debugging to ensure stable connectivity and optimal throughput from day one.

Integration steps

  1. Launch the Alinux instance: Provision the instance using the ECS API with the official Alinux image.
  2. aliyun ecs RunInstances --RegionId cn-hangzhou --ImageId aliyun_3_x64_20G_alibase_*.qcow2 --InstanceType ecs.c7.xlarge --SecurityGroupId sg-xxx --VSwitchId vsw-xxx

  3. Attach a secondary ENI: Create and bind an Elastic Network Interface for isolated traffic.
  4. aliyun ecs CreateNetworkInterface --VSwitchId vsw-xxx --SecurityGroupId sg-xxx aliyun ecs AttachNetworkInterface --InstanceId i-xxx --NetworkInterfaceId eni-xxx

  5. Assign a Public IP (EIP): Allocate and associate an EIP for outbound package management and debugging.
  6. aliyun vpc AllocateEipAddress --RegionId cn-hangzhou aliyun vpc AssociateEipAddress --AllocationId eip-xxx --InstanceId i-xxx

  7. Configure Security Group Rules: Explicitly allow SSH and ICMP for initial validation.
  8. aliyun ecs AuthorizeSecurityGroup --SecurityGroupId sg-xxx --IpProtocol tcp --PortRange 22/22 --SourceCidrIp 0.0.0.0/0

  9. Tune Kernel Parameters: SSH into the instance and apply Alinux-optimized network stack settings.
  10. sudo sysctl -w net.core.rmem_max=16777216 net.core.wmem_max=16777216 net.ipv4.tcp_tw_reuse=1 echo "net.core.rmem_max=16777216" | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

  11. Validate & Troubleshoot: If sysctl -p throws unknown key or connectivity drops, cross-reference OS logs with cloud state.
  12. journalctl -u network --no-pager | grep -i error ip route show && ping -c 3 8.8.8.8 Use aliyun ecs DescribeInstanceStatus and aliyun ecs DescribeNetworkInterfaces to verify cloud-side resource alignment.

Architecture

The ECS control plane orchestrates virtualized infrastructure (ENI, Security Groups, EIP) and injects it into the guest OS via virtio drivers. Alinux manages the network stack initialization, routing table population, and kernel parameter enforcement. Troubleshooting flows bidirectionally: OS-level diagnostics (journalctl, sysctl, ip) validate local configuration, while ECS APIs (DescribeInstanceStatus, DescribeNetworkInterfaces) verify cloud-side state, enabling rapid isolation of misconfigurations.

Prerequisites

Common pitfalls

Typical questions