DDoS Protection in Turkey: Hosting & ISP Guide
DDoS protection in Turkey works best as layers. Detect attacks from flow data at your edge, use BGP blackhole (RTBH) and FlowSpec for small and medium attacks, and move prefixes on your own ASN behind a GRE + BGP tunnel to cloud scrubbing when attacks outgrow your uplinks or when blackholing the victim is not acceptable. The right mix depends on where your attack traffic enters, how much of your traffic is domestic, and what your upstreams actually support.
This guide is for hosting providers and ISPs running servers in Turkey. It covers mapping ingress paths across local transit and IX peering, configuring detection, using RTBH and FlowSpec, and deciding when a DDoS tunnel makes sense.
Step 1: Map where attack traffic enters
Before you buy or configure anything, know your ingress paths. A typical Turkish hosting edge has some mix of:
| Ingress path | Typical traffic | What you can do about attacks |
|---|---|---|
| Local transit | Domestic and international | RTBH community, sometimes FlowSpec (provider-dependent) |
| IX peering | Domestic eyeballs and content | Filter at your edge; blackhole only if the IX or peer supports it |
| International transit | Most large volumetric attacks | RTBH community, upstream filtering, or scrubbing |
| Private peering | Specific networks | Bilateral agreement, edge ACLs |
Two practical rules:
- Export flow from every edge router, not only the transit ones. An attack arriving over an IX port is invisible if you only sample uplinks.
- Ask each upstream in writing which blackhole community they accept, whether they accept FlowSpec from customers, the maximum prefix length for blackhole routes, and whether they require your prefixes to be in IRR. Do not assume the standard RFC 7999 community (65535:666) works everywhere. Many providers use their own.
Step 2: Detect from flows
Flow-based detection (NetFlow v5/v9, IPFIX, sFlow) is the foundation because it is cheap, works on routers you already own, and gives per-IP and per-prefix bps/pps visibility. Export to a collector, here 192.0.2.10 on UDP 2055.
MikroTik (RouterOS v7):
/ip traffic-flow set enabled=yes interfaces=sfp-transit1,sfp-ix1
/ip traffic-flow target add dst-address=192.0.2.10 port=2055 version=9
Cisco IOS-XE (Flexible NetFlow):
flow exporter COLLECTOR
destination 192.0.2.10
transport udp 2055
export-protocol netflow-v9
flow monitor DDOS-MON
exporter COLLECTOR
record netflow ipv4 original-input
interface TenGigabitEthernet0/0/0
ip flow monitor DDOS-MON input
Juniper (inline IPFIX, abbreviated):
set services flow-monitoring version-ipfix template T4 ipv4-template
set forwarding-options sampling instance DDOS input rate 1000
set forwarding-options sampling instance DDOS family inet output flow-server 192.0.2.10 port 2055
set forwarding-options sampling instance DDOS family inet output flow-server 192.0.2.10 version-ipfix template T4
set forwarding-options sampling instance DDOS family inet output inline-jflow source-address 192.0.2.1
set chassis fpc 0 sampling-instance DDOS
You still need a firewall filter with then sample applied on the interfaces. Set thresholds per destination IP and per prefix, in both pps and bps. Small hosting VMs fall over at pps levels that look harmless in bps.
Step 3: Use RTBH for the first line of defense
RTBH tells upstreams to drop all traffic to one victim /32. It stops collateral damage to your other customers, but the victim is offline for the duration. That is a trade-off, not a fix.
A Juniper example that tags a static discard route with a blackhole community and exports it only to transit:
set policy-options community BLACKHOLE members 65535:666
set routing-options static route 192.0.2.55/32 discard
set policy-options policy-statement TO-TRANSIT term rtbh from protocol static
set policy-options policy-statement TO-TRANSIT term rtbh from route-filter 192.0.2.0/24 prefix-length-range /32-/32
set policy-options policy-statement TO-TRANSIT term rtbh then community add BLACKHOLE
set policy-options policy-statement TO-TRANSIT term rtbh then accept
Replace 65535:666 with your provider's specific community if required. The same idea in BIRD on a Linux route server or collector:
protocol static rtbh {
ipv4;
route 192.0.2.55/32 blackholed;
}
filter to_transit {
if net ~ [192.0.2.0/24{32,32}] then {
bgp_community.add((65535,666));
accept;
}
reject;
}
Common RTBH mistakes:
- No export filter, so a typo blackholes someone else's space or a whole /24.
- No automatic withdrawal. Blackholes should expire after a timer, then be re-evaluated.
- Blackholing the gateway or DNS resolver IP.
- Forgetting that RTBH accepted by one transit does not remove attack traffic arriving over IX or other transit links. Apply discard internally too.
Step 4: Use FlowSpec when you need precision
FlowSpec lets you drop or rate-limit only the attack traffic, for example UDP source port 11211 or 123 toward a victim, while legitimate traffic keeps flowing. It works well inside your own network, between your detection system and your edge routers. Support from upstream providers varies, so verify before depending on it.
A minimal Juniper import setup for FlowSpec from a collector at 198.51.100.5:
set routing-options flow term-order standard
set protocols bgp group FLOWSPEC type internal
set protocols bgp group FLOWSPEC neighbor 198.51.100.5 family inet flow no-validate FS-IMPORT
set policy-options policy-statement FS-IMPORT term ok from route-filter 192.0.2.0/24 orlonger
set policy-options policy-statement FS-IMPORT term ok then accept
set policy-options policy-statement FS-IMPORT term other then reject
Safety checks:
- Accept FlowSpec rules only for prefixes you own.
- Know your router's rule and TCAM limits and cap the number of active rules.
- Prefer rate-limit over discard for ambiguous traffic like DNS or TCP/443.
- Test on a lab or a single non-critical router first. Some platforms behave differently by line card.
Step 5: When to add a GRE + BGP tunnel with cloud scrubbing
RTBH and FlowSpec only help while the attack still fits through your uplinks. Move to cloud scrubbing when one or more of these is true:
- Attacks saturate transit or IX ports before your edge can filter them.
- Blackholing the victim means losing the customer, such as a game server, shop, or API.
- You see carpet-bombing across a whole prefix, which makes per-IP RTBH impractical.
- Your edge routers cannot hold enough FlowSpec rules.
- You want protection without buying and operating more hardware.
The model is simple. Your prefixes are announced from the scrubbing edge, so attack traffic lands there first. Clean traffic comes back to you over a GRE tunnel, with a BGP session inside the tunnel. You need your own ASN and at least one /24, since that is the smallest prefix generally accepted in the global table. Prefix filtering normally uses your AS-SET and IRR objects, so keep those clean and current.
A Linux-side tunnel endpoint looks like this:
ip tunnel add gre-scrub mode gre local 198.51.100.10 remote 203.0.113.200 ttl 255
ip addr add 10.255.0.2/30 dev gre-scrub
ip link set gre-scrub mtu 1476 up
iptables -t mangle -A FORWARD -o gre-scrub -p tcp --tcp-flags SYN,RST SYN \
-j TCPMSS --clamp-mss-to-pmtu
Then run BGP over 10.255.0.1/10.255.0.2 with your ASN (for example AS64500) and filter what you accept and announce. Details on MTU and MSS are covered in our GRE tunnel MTU article.
Always-on or on-demand?
- Always-on gives the fastest response and removes the BGP convergence delay when an attack starts. Traffic always crosses the tunnel, so consider the added latency.
- On-demand keeps normal traffic on your local transit and IX paths, which matters for Turkish users sensitive to latency. You announce to the scrubbing edge only when an attack is detected, and convergence takes some time.
Ask any scrubbing provider where its edge sits relative to your users and upstreams, because the path from the scrubbing location to your router affects latency after cleaning.
Putting the layers together
- Flow export from all edge routers to a collector.
- Per-IP and per-prefix thresholds, with hysteresis to avoid flapping.
- Small attack: FlowSpec or edge ACL for the attack signature.
- Larger attack on one IP: RTBH with automatic expiry, if the victim can tolerate it.
- Attack beyond your capacity or on critical services: divert the prefix to cloud scrubbing and receive clean traffic over the tunnel.
- Log everything and review after each incident.
How NixMon fits
NixMon detects attacks from NetFlow v5/v9, IPFIX, and sFlow with sub-second analytics and per-IP/per-prefix bps/pps thresholds. It can trigger BGP blackhole and FlowSpec announcements or an on-prem firewall (NixGuard). For prefixes on your own ASN with at least one /24, NixGuard Edge provides cloud scrubbing with clean traffic delivered over a GRE tunnel with BGP inside, either always-on or on-demand. You can test the detection side with the 15-day free trial, no credit card needed.
Common mistakes to avoid
- Sampling only transit links and missing attacks arriving over IX.
- Assuming upstreams accept the standard blackhole community without checking.
- No prefix-length and prefix-ownership filters on RTBH and FlowSpec exports.
- Ignoring GRE overhead, which causes MTU and MSS issues.
- Missing or outdated AS-SET and IRR objects, which blocks the scrubbing announcement.
- Waiting until the first large attack to test the process.
Frequently asked questions
Can I use RTBH on Turkish transit providers?
Many transit providers support customer-triggered blackhole communities, but the community value, accepted prefix length and requirements differ. Ask each upstream for its documented blackhole community and test with a lab or non-critical /32 before relying on it.
Does blackholing work over IX peering?
Only if the IX or the specific peer supports blackhole signaling. Otherwise, discard the attack traffic at your own edge and rely on FlowSpec, ACLs, or scrubbing for volumes that threaten the port.
What do I need to use a GRE and BGP tunnel for DDoS scrubbing?
You need your own ASN, at least one /24, a router or Linux host that can terminate GRE and run BGP, and up-to-date AS-SET and IRR objects for prefix filtering. NixGuard Edge works on this model.
Should I choose always-on or on-demand scrubbing?
Always-on removes the detection and BGP convergence delay but sends all traffic through the tunnel. On-demand keeps normal traffic on your local paths and diverts only during attacks. Latency sensitivity and attack frequency should drive the choice.