VPS Tutorials
Respond to DDoS on a VPS: Traffic Layers, Null Routes and Origins (2026)
Identify attack evidence and traffic direction, coordinate upstream mitigation, assess billing and origin exposure, and verify a tested recovery path.

An unreachable website, failed SSH and a saturated bandwidth graph can indicate DDoS, but can also reflect an outage, legitimate traffic or resource failure. Identify the traffic direction, affected layer and actual target before changing IPs or buying mitigation.
During a flood, the normal management path may be unavailable. Use the provider's control plane or console where accessible, preserve evidence and coordinate upstream help. A host firewall cannot reclaim bandwidth already saturated before traffic reaches the VPS.
Compare provider traffic graphs with normal demand, logs and interface counters. Provider telemetry can be delayed or sampled; a sharp inbound rise is evidence to investigate, not definitive proof. If SSH fails, an independent console may still work:
# 总览:看 synrecv、TCP 连接状态分布
ss -s
# 实时看哪条连接在吃带宽
iftop -P -n
# 看网卡累计收发
vnStat -l # 实时带宽
cat /proc/net/dev
Tools must be installed and the console itself available. The following bounded capture uses an example interface; replace it with the real one:
tcpdump -i eth0 -nn -c 100 'tcp[tcpflags] & tcp-syn != 0'
This filter selects SYN-bearing packets, including SYN-ACK. Seeing 100 such packets is therefore not proof of a SYN flood. Compare rates, directions, incomplete/completed handshakes and baseline traffic. Source IPs may be spoofed. Restrict captures that can contain sensitive traffic.
| Symptom | Possible cause | Next check |
|---|---|---|
| Requests/CPU rise without full bandwidth | HTTP flood, bots, legitimate demand or application bottleneck | Application-layer incident checklist |
| Low throughput with high latency | Provider shaping, congestion or capacity issue | Bandwidth limiting |
| Gradual traffic increase | Crawling or business growth | Access logs and measured rate limits |
| Unexpected outbound traffic | Compromise, backup/export or another process | Compromise response |
An infected VPS can become an attack source, but outbound traffic alone does not establish compromise. Identify the process and destination; if compromised, contain it and preserve evidence rather than treating it only as incoming DDoS.
Application-layer HTTP floods can also be DDoS. “CC” commonly describes automated application requests; it is not a separate exclusion from distributed denial of service.
| L3/L4 | L7 | |
|---|---|---|
| Examples | SYN/UDP/ICMP floods and DNS/NTP amplification | HTTP floods, slow requests and abusive login traffic |
| Typical pressure | Link capacity, packet rate, connection state | Workers, CPU, database/pools and expensive routes |
| Protection | Provider/upstream filtering, scrubbing and protected routing | WAF, measured rate limits, challenges and caching |
| Scope | Multiple services sharing the affected path | Usually attacked routes, possibly shared resources |
Cloudflare protects its own edge against network/transport attacks as well as offering HTTP defenses. Ordinary CDN proxying does not protect a VPS IP from a flood sent directly to that origin. Such traffic bypasses Cloudflare, regardless of the website plan. Proxied HTTP protection and origin-network protection must be assessed separately.
- A new IP may escape an attack aimed only at the old address, but this is not guaranteed.
- An attacker tracking a domain or another discovery channel may follow the new address.
Use timestamps, targets and provider evidence. Reappearance within 24 hours can be a clue, not proof; avoid exposing a replacement solely as an experiment.
If business impact permits, pause an attacked service or apply a narrow temporary rule:
# 先把被打的服务停掉,保住管理通道
systemctl stop nginx
# 临时屏蔽某个明显的攻击源段(注意:对分布式攻击基本没用,别指望它)
iptables -I INPUT -s 1.2.3.0/24 -j DROP
# 打开 SYN Cookies,缓解 SYN Flood
sysctl -w net.ipv4.tcp_syncookies=1
These are illustrative actions, not a batch to run blindly. Stopping Nginx takes the website down. Replace the sample subnet only after verifying it; preserve administration access and record rollback. SYN cookies can help particular TCP-state pressure, not link saturation. Host firewalls filter L3/L4 traffic too and can protect local resources, but cannot undo upstream bandwidth exhaustion.
Ask:
- Is upstream scrubbing available, or only null routing?
- What are IP-replacement charges, timing and approval conditions?
- Which attack traffic/mitigation costs count toward quotas or billing?
Provide time, IP, traffic direction, packet/bit rates and affected services through a private support channel. Never assume a low-cost provider has the same policy as another.
Charges differ for ingress, egress, requests, load balancers and mitigation. Attack traffic is not universally billed. Check the tariff, quota and supported controls immediately. Alerts are not automatically hard spending caps; controls may interrupt service. See usage-based billing controls.
RTBH discards traffic upstream to protect the network, usually making the address unavailable even while the VM runs.
- Thresholds/timers vary; 1 or 10 Gbps are examples, not universal triggers.
- Failed
ping/traceroutecan be consistent with null routing but also with ICMP filtering or an outage. - Restoration can be automatic or manual after the provider's observation period; ask for the actual policy and evidence.
Null routing is an availability tradeoff, not necessarily an account penalty. If its duration exceeds your business tolerance, arrange upstream protection or an independently protected failover path. A price or advertised protection number alone is insufficient.
For eligible web traffic:
Under Attack Modecan challenge browser traffic; test APIs, accessibility and legitimate visitors.- Cache genuinely cacheable static responses to reduce origin work.
- Apply available WAF/rate-limit/IP or regional rules according to the plan and traffic evidence.
- Proxy intended supported web records and audit other origin disclosures.
Ordinary CDN proxying does not:
- Scrub traffic sent directly to the origin IP.
- Automatically proxy arbitrary games/UDP/custom protocols; Spectrum support depends on product, protocol and plan.
- Protect DNS-only or direct-access services.
Audit current records:
# 查一遍还有哪些子域名暴露着真实 IP
dig +short www.example.com
dig +short mail.example.com
dig +short panel.example.com
Check mail., dev., direct. and cpanel.. Mail and other unsupported services cannot simply all become proxied web records; separate their hosts/addresses if they disclose the web origin.
For HTTP/HTTPS origin restrictions, obtain and verify Cloudflare's current ranges at https://www.cloudflare.com/ips-v4. This source example illustrates IPv4 INPUT rules only:
# 示例:只放行 Cloudflare 段访问 80/443
for ip in $(curl -s https://www.cloudflare.com/ips-v4); do
iptables -A INPUT -p tcp -s $ip -m multiport --dports 80,443 -j ACCEPT
done
iptables -A INPUT -p tcp -m multiport --dports 80,443 -j DROP
Verify downloaded ranges before applying rules, keep console/SSH access and a firewall backup, and account for existing rule order, IPv6, containers and the actual traffic chain. A failed download followed by DROP can cut off the site; Docker-published ports may use a different chain. Host rejection still cannot protect a saturated upstream link.
Cloudflare Tunnel can remove public listeners for the application by using outbound connectors. It does not erase the VPS's public IP or protect that IP if independently discovered/attacked. Audit unrelated listeners and coordinate provider protection where needed.
| Channel | Check |
|---|---|
| Historical DNS | Old address records in third-party archives |
| Certificate transparency | Names revealed through crt.sh, then their DNS |
| Self-hosted mail | Received in received headers |
| Other services | Authorized inspection of panels, databases and game ports |
| Internet scanning | Your own addresses in Shodan/Censys |
| Prior compromise | crontab, systemd and authorized_keys |
Close unnecessary disclosures when migrating. Removing current DNS entries cannot delete third-party historical archives. A replacement remains discoverable if the same mail/direct-service path reveals it.
| Situation | Evaluate |
|---|---|
| Address-only targeting | Replacement cost and likelihood of rediscovery |
| Domain-following attack | Appropriate protection and origin restrictions |
| Null-route-only provider exceeds downtime tolerance | Protected provider/path and tested migration |
| Usage billing exposes large costs | Billing controls and a suitable tariff first |
| Repeated customer impact | Sustained mitigation with verified capacity/SLA |
Bring up and test the replacement, transfer data consistently and plan DNS TTL ahead of cutover. Lowering TTL does not expire already cached records instantly. Retain rollback before stopping the old system. See migration.
Raksmart is the source's example of advertised regional protection tiers, including a historical starting figure of 200 Gbps in Asia-Pacific and higher North American claims. These are vendor marketing figures, not this site's measured protection or a current product guarantee. Confirm the specific location, covered protocols, thresholds, shared capacity, clean bandwidth and terms. Shared scrubbing can face contention; visitor counts alone cannot establish adequacy.
Confirm routing, protocol coverage, latency, policy control, activation time and fees, often monthly/capacity-based. Choose from expected traffic and outage cost, not just the largest advertised number.
The source cites Racknerd and CloudCone as budget annual examples. Do not infer protection or its absence solely from price/brand. Verify the actual datacenter and null-route policy. Multiple inexpensive instances can help some address-targeted incidents, but may share an upstream and do not replace protection for a domain-following attack. Include replication, recovery, IP and outage costs in the comparison.
- Audit proxy/Tunnel use and current origin disclosures, recognizing historical DNS persists elsewhere.
- Restrict web-origin ingress to verified intended sources; distinguish host filtering from upstream mitigation.
- Close unnecessary databases, panels and Docker APIs.
- Review SYN cookies/connection limits against actual TCP load.
- Add measured L7 limits/challenges; see Nginx hardening.
- Alert on traffic/error anomalies; see monitoring and quota warnings.
- Test migration, backups and deployments against a chosen recovery-time target; do not assume every service can move in 30 minutes.
Account action, null-route duration, IP charges and attack billing depend on the provider. Outbound abuse can violate terms; investigate direction and compromise evidence. Use the support guide and egress billing explanation to ask precise questions.
Free CDN capabilities may help eligible HTTP traffic but do not guarantee availability or protect a directly attacked VPS IP. Packet sources can be spoofed, amplified or botnet nodes, making attribution difficult. Preserve evidence for the provider/appropriate investigation rather than assuming a visible IP is the attacker.
Confirm services through the actual production path, administration access, normal traffic/error levels, billing exposure and rule rollback. Test failover and backup recovery. The useful decision is protection matched to the real attack path and business tolerance, with enough evidence to verify it.