RepositoryShell
mkorthof

mkorthof/ipset-country

Block countries using iptables + ipset + ipdeny.com

97sao
26fork
0issue
4lượt xem

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: ipdeny

#1 Repository của tháng

1
TINIX TRENDING·Chủ đề: firewalld

#1 Repository của tháng

1
TINIX TRENDING·Chủ đề: countrycodes

#1 Repository của tháng

🔥 Chặn lọc theo quốc gia chỉ trong vài phút với ipset-country

Một script Shell nhẹ, tự động cập nhật danh sách IP theo quốc gia và gắn vào firewall để block hoặc allow lưu lượng đến.

ipset-country của mkorthof giúp bạn dùng iptables + ipset, nftables hoặc firewalld để lọc truy cập theo quốc gia một cách nhanh chóng. Dữ liệu IP lấy từ ipdeny.com (hoặc ipverse.com nếu muốn), hỗ trợ cả IPv4 và IPv6, chỉ chặn inbound traffic. Cài đặt bằng systemd timer (-i) hoặc chạy thủ công và thêm vào cron.

✨ Điểm nổi bật

  • Đa nền tảng firewall: hỗ trợ iptables, nftables và firewalld trên cả Debian và RedHat.
  • Blacklist/Whitelist: chọn chặn quốc gia nào (MODE=reject/drop) hoặc chỉ cho phép quốc gia nào (MODE=accept).
  • IPv4 & IPv6: tải và áp dụng danh sách IP cho cả hai giao thức.
  • Tự động cập nhật: dùng cron hoặc systemd timer để cập nhật quy tắt định kỳ.
  • Cấu hình linh hoạt: thiết lập trong script hoặc file cấu hình riêng (-c /path/to/conf).
  • Hỗ trợ nhiều nguồn IP: mặc định ipdeny.com, có thể chuyển sang ipverse.com hoặc nguồn khác.
  • Ghi log: ghi lại hoạt động và lỗi vào file log mặc định /var/log/ipset-country.log.

💡 Vì sao đáng chú ý

Không cần phứ thức cài đặt firewall từng quy tắc. Chỉ cần chỉ định vài quốc gia và chạy script — nó tự động tạo ipset/nft set, thêm rule vào INPUT chain và cập nhật định kỳ. Phù hợp cho server cần kiển soát truy cập theo vùng địa lý nhanh chóng, đặc biệt khi không có giải pháp firewall management phức tạp.


#iptables #ipset #nftables #firewalld #ShellScript #IPv6 #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryShell
maravento/blackip

IPv4 Blacklist for Ipset or Squid-Cache

116
Nov 22, 2026
RepositoryShell
Adamm00/IPSet_ASUS

Skynet - IPv4 firewall protection, threat feeds and traffic visibility for Asuswrt-Merlin. Manage your network through the WebUI or SSH.

447
Oct 31, 2026
Repository
stamparm/ipsum

Daily feed of bad IPs (with blacklist hit scores)

2.4k
Dec 1, 2026
RepositoryPython
firewalld/firewalld

Stateful zone based firewall daemon with D-Bus interface

1.1k
Oct 31, 2026
RepositoryShell
firehol/firehol

A firewall for humans...

1.6k
Mar 31, 2026
RepositoryShell
borestad/blocklist-abuseipdb

Aggregated AbuseIPDB blocklists with worst IPv4 & IPv6 offenders (~99% confidence)

623
Nov 28, 2026
RepositoryShell
friendly-bits/geoip-shell

User-friendly and versatile geoblocker for Linux

544
Nov 21, 2026
RepositoryShell
AliDbg/IPBAN

⚔️🧱🔥🛑IP BAN Block Allow GEOIP country traffic limit server input/output to IP countries with iptables+xt_geoip, auto db-ip update, firewall fail2ban gfw ufw cidr blacklist netfilter rules persistent restrict netaddr xtables linux debian ubuntu apache nginx web server anti hack ddos firewalld ipblocks ipdeny ip ranges MaxMind ipset

152
Feb 1, 2024
RepositoryShell
szorfein/paranoid-ninja

Script to apply a Transparent proxy through Tor with nftables or iptables and can optionally forge a random MAC, localtime, ip, hostname.

126
Apr 6, 2020