Initial commit: OpenWrt firewall management scripts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
14
update_tw_ip.sh
Executable file
14
update_tw_ip.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
# 下載最新台灣 IP 清單
|
||||
curl -s https://www.ipdeny.com/ipblocks/data/countries/tw.zone > /tmp/tw.zone
|
||||
|
||||
# 更新集合 (fw4 會自動處理 auto-merge)
|
||||
nft flush set inet fw4 taiwan_ips
|
||||
for ip in $(cat /tmp/tw.zone); do
|
||||
nft add element inet fw4 taiwan_ips { $ip }
|
||||
done
|
||||
|
||||
# 萬一你的 VPS IP 沒被網段涵蓋,這邊可以手動補強 (選配)
|
||||
# nft add element inet fw4 taiwan_ips { 211.23.141.206 }
|
||||
|
||||
logger "Firewall: Taiwan IP set updated."
|
||||
Reference in New Issue
Block a user