温馨提示×

Ubuntu iftop命令的过滤器如何设置

小樊
93
2024-08-11 12:28:36
栏目: 智能运维

在使用iftop命令时,可以通过指定过滤器来过滤网络流量。过滤器的格式为expression,可以根据源IP地址、目标IP地址、端口号等信息来过滤。

以下是一些常用的过滤器示例:

  1. 过滤指定源IP地址的流量:
sudo iftop -i eth0 -f "src host 192.168.1.10"
  1. 过滤指定目标IP地址的流量:
sudo iftop -i eth0 -f "dst host 192.168.1.20"
  1. 过滤指定源端口的流量:
sudo iftop -i eth0 -f "src port 80"
  1. 过滤指定目标端口的流量:
sudo iftop -i eth0 -f "dst port 443"
  1. 过滤指定源IP地址和目标端口的流量:
sudo iftop -i eth0 -f "src host 192.168.1.30 and dst port 22"

通过设置不同的过滤器,可以根据自己的需求来查看特定的网络流量信息。

0