在Debian系統中,使用nftables添加規則的過程如下:
sudo apt update
sudo apt install nftables
sudo systemctl start nftables
sudo systemctl enable nftables
sudo nft list ruleset
nft add
命令。以下是一些常見的nftables規則示例:sudo nft add rule ip filter input tcp dport 80 accept
sudo nft add rule ip filter input udp dport 123 accept
sudo nft add rule ip filter input ip saddr 192.168.1.100 tcp dport 22 reject
sudo nft add rule ip filter input ip saddr 192.168.1.100 rate 100mbit burst 50kbit
/etc/nftables.conf
。你可以使用以下命令將當前規則集保存到該文件中:sudo nft list ruleset > /etc/nftables.conf
現在你已經成功地在Debian系統中使用nftables添加了一些基本規則。你可以根據需要修改這些規則以滿足你的網絡需求。