Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of viewing the access Traffic of Linux Network Card

Shulou Source: shulou.com Published: 2022-06-02 08:27:45 10月18日 Update

Install the iftop command (based on epel source) [root@node ~] # yum install-y iftop [root@node ~] # iftop-I eth0 # to view the amount of access traffic for an IP After entering, you can press T key to observe the total traffic of IP [root@node] # iptables-I INPUT-p tcp-s 192.168.81-- dport 80-j DROP # to block [root@node] # iptables-I INPUT-p tcp-s 192.168.81-- dport 443-j DROP [root@node] # iptables-vnLChain INPUT (policy ACCEPT 6 packets 428 bytes) pkts bytes target prot opt in out source destination 0 DROP tcp-- * * 192.168.81 0.0.0.0 DROP tcp-- * * 192.168.8.81 0.0.0. 0 tcp dpt:80 [root@node ~] # iptables-save > / etc/sysconfig/iptables [root@node ~] # vim / etc/rc.localiptables-restore < / etc/sysconfig/iptables [root@node ~] # chmod aplyx / etc/rc.local# Delete iptables rules [root@node ~] # iptables- D INPUT-p tcp-s 192.168.81-dport 80-j DROP # Delete iptables rules

Tags: Traffic size rules commands total traffic blocking observation method network card Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Huawei Redmi Shulou Tech Info Shulou Information