基本的 /root/firewall.sh 根據上述的建議,來設定:
#!/bin/bash
# VBird
iptables -F
iptables -X
iptables -Z
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -s somewhere/prefix -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport AAA -j ACCEPT
iptables -A INPUT -p tcp --dport 5901:5910 -j ACCEPT
iptables-save > /etc/sysconfig/iptables
sleep 1s
systemctl restart iptables
iptables-save
將上述底線字體改成符合你的設定即可!然後記得要執行!『sh /root/firewall.sh』