新用戶新用戶即享 DNS 與 CDN 免費方案。建立帳號

Networking and public IPs

View and configure your instance's public IPs, understand bandwidth and traffic, and set up an OS firewall.

4 分鐘閱讀 更新於 2026年10月6日

This page covers your cloud server's public IP addresses, bandwidth and traffic, and how to set up a firewall for the instance.

Public IP addresses

Each instance is assigned public IP addresses automatically when it is created, according to its plan. For fixed plans the number of IPs is set by the plan; for elastic plans you choose the number with the 公网IP (Public IPs) slider when you buy.

The IP 地址 (IP addresses) card on the instance detail page lists every address:

  • The address tagged 主 (Primary) is the main IP. It is configured inside the instance automatically and can be used straight away for SSH or Remote Desktop.
  • Each address is labelled with its type (V4 or V6).
  • Click an address to expand its details: MAC 地址 (MAC address), 网关 (Gateway), 子网掩码 (Netmask, IPv4) or 前缀长度 (Prefix length, IPv6), and DNS 1 / DNS 2.

If you need to configure networking by hand (for example, to repair the network configuration from VNC), use the gateway, netmask and DNS values shown here.

Configure additional IPs

If the instance has more than one IP, you need to add every address other than the primary one inside the operating system yourself. Expand the address and the 配置命令 (Configuration command) field gives a ready-to-copy command, for example:

bash
ip addr add 203.0.113.11/24 dev eth0
Warning

Addresses added with ip addr add are lost on reboot. Add them to your distribution's persistent network configuration. Also, the interface inside the instance is not always called eth0; check with ip link first.

Persistent configuration on Debian / Ubuntu with ifupdown (edit /etc/network/interfaces):

text
auto eth0:1
iface eth0:1 inet static
    address 203.0.113.11
    netmask 255.255.255.0

On Ubuntu with netplan (edit the file under /etc/netplan/, add the address under addresses, then run netplan apply):

yaml
network:
  version: 2
  ethernets:
    eth0:
      addresses:
        - 203.0.113.10/24
        - 203.0.113.11/24

On CentOS / RHEL-family systems, use nmcli:

bash
nmcli connection modify eth0 +ipv4.addresses 203.0.113.11/24
nmcli connection up eth0

Bandwidth and traffic

  • Bandwidth: 基础信息 > 带宽 (Basic info > Bandwidth) on the detail page shows the instance's outbound bandwidth cap in Mbps, set by the plan.
  • Traffic: 基础信息 > 流量 (Basic info > Traffic) shows traffic used against the plan's allowance. The Traffic Statistics card further down the page shows usage for the current period (Monthly Usage), total Download and Upload, and a breakdown by IP (Per-IP Statistics).
  • When the allowance is reached, the instance status may change to 流量限制 (Traffic limited). Contact support if you have questions.

Set up a firewall

Warning

The 云服务器 menu currently contains 专有网络 (VPC), 弹性IP (Elastic IP), 安全组 (Security Groups) and 端口转发 (Port Forwarding) pages, but these features cannot yet be used with cloud servers. In particular, security group rules are not currently applied to instance traffic, so do not rely on them to protect your instance. Configure a firewall inside the instance's operating system instead.

When an instance is created, all ports are reachable from the internet by default. Set up the OS firewall as soon as you log in and open only the ports you need.

Ubuntu / Debian (ufw):

bash
apt install -y ufw
ufw allow 22/tcp      # SSH: allow it before enabling so you don't lock yourself out
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
ufw status

CentOS / RHEL family (firewalld):

bash
systemctl enable --now firewalld
firewall-cmd --permanent --add-service=ssh
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

Windows: manage inbound rules in "Windows Defender Firewall with Advanced Security", and keep Remote Desktop (TCP 3389) allowed.

Tip

If a firewall mistake locks you out of SSH, log in through VNC or 终端 (Terminal) on the detail page to fix it. They do not depend on the instance's network. See Connect to a cloud server.

Change the SSH port (optional)

Moving SSH to a non-default port cuts down on automated scanning. On Linux:

  1. Edit /etc/ssh/sshd_config and change Port 22 to a new port, for example Port 22022.
  2. Allow the new port in your firewall (for example ufw allow 22022/tcp).
  3. Run systemctl restart sshd (on some distributions the service is called ssh).
  4. In a new window, confirm you can log in with ssh -p 22022 root@<instance-ip> before closing the old session.
這個頁面對你有幫助嗎?