昨天ssh着服务器写代码,突然就卡死了,从服务器控制台登录进去发现有个憨皮拿icmp打我机子,所以就开了nftables 过滤掉从外网接口进来的icmp流量。
代码:
iifname "eth0" ip protocol icmp counter drop comment "eth0 drop icmp"
iifname "eth0" ip6 nexthdr icmpv6 counter drop comment "eth0 drop icmp"
iifname "lxcbr0" ip protocol icmp counter accept comment "lxcbr0 accept icmp"
iifname "lxcbr0" ip6 nexthdr icmpv6 counter accept comment "lxcbr0 accept icmp"
lxcbr0是我lxc的内网,因为要使用icmp诊断,所以内网的icmp就不用禁用了