Memo/simulate-packet-loss-with-nftables
1 分钟阅读
使用 nftables 模拟丢包
丢弃指定 TCP 端口的入站流量并恢复规则。
丢弃目标端口的入站 TCP 流量:
sudo nft create table ip filter
sudo nft add chain ip filter input { type filter hook input priority 0 \; }
sudo nft add rule ip filter input tcp dport 3888 counter drop
恢复前先查看 handle,再删除对应规则:
sudo nft list chain ip filter input sudo nft delete rule ip filter input handle n
讨论
邮箱用于身份识别和回复通知,并由 Waline 存储。