在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添加了一些基本规则。你可以根据需要修改这些规则以满足你的网络需求。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>