All gists matching topic ddos-protection

timmy / 強化的 iptables 防火牆規則設定

0 polubień
0 forków
1 plików
Ostatnio aktywne 10 months ago
這個 iptables 防火牆腳本 用於 強化伺服器的網路安全,透過 允許合法流量(如 SSH、HTTP/HTTPS)並封鎖未授權連線,同時防禦各種攻擊(如 暴力破解、SYN Flood、埠掃描、DoS)。此外,它會 記錄異常流量 以便後續分析,並將規則儲存至 /etc/iptables/rules.v4,確保設定在重啟後仍生效。適用於 企業伺服器、內部網路防護及個人伺服器安全強化。
1 #!/bin/bash
2
3 # === Basic Settings ===
4
5 # Clear all existing rules
6 iptables -F
7 iptables -X
8 iptables -Z
9
10 # Set default policies: drop all incoming and forwarding traffic, allow outgoing
Nowsze Starsze