Debian系統提供了多種防火墻管理工具,其中最常用的是iptables、firewalld和nftables。每種工具都有其獨特的特點和使用場景。以下是一些使用技巧:
sudo apt-get install iptables
sudo iptables-save > /etc/iptables/rules.v4
sudo iptables-restore < /etc/iptables/rules.v4
sudo systemctl status firewalld
sudo systemctl start firewalld
sudo systemctl enable firewalld
sudo firewall-cmd --zone=public --add-interface=eth0 --permanent
sudo firewall-cmd --reload
sudo apt-get install nftables
sudo nft add table inet filters
sudo nft add chain inet filter input { type filter hook input }
sudo apt install ufw
sudo ufw enable
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow from 192.168.1.100
以上就是在Debian系統上使用iptables、firewalld和UFW防火墻的一些基本技巧。根據具體需求選擇合適的防火墻工具,并合理配置可以有效地提升系統的安全性。