当我更改 INPUT 的默认策略时,iptables -L 的输出在第三行之后停止。我通过 ssh 和本地检查了它。我的终端的输出(是的,我知道我不应该使用 root)。
root@pi4:/# iptables -L -v
Chain INPUT (policy ACCEPT 73 packets, 16085 bytes)
pkts bytes target prot opt in out source destination
261 18964 ACCEPT tcp -- any any 192.168.0.0/16 anywhere tcp dpt:60022
94 7786 ACCEPT all -- lo any anywhere anywhere
0 0 ACCEPT tcp -- any any 192.168.0.0/16 anywhere tcp dpt:netbios-ssn
0 0 ACCEPT tcp -- any any 192.168.0.0/16 anywhere tcp dpt:microsoft-ds
0 0 ACCEPT udp -- any any 192.168.0.0/16 anywhere udp dpt:netbios-ns
4 962 ACCEPT udp -- any any 192.168.0.0/16 anywhere udp dpt:netbios-dgm
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
root@pi4:/# iptables -P INPUT DROP
root@pi4:/# iptables -L -v
Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
^C
root@pi4:/#