For troubleshooting a server, the following tools are needed which are very helpful in monitoring traffic.
- iptraf
sudo yum install iptraf
sudo apt-get install iptraf
- iftop
sudo yum install iftop
sudo apt-get install iftop
- lsof
lsof -i 4 --> monitor trafik dengan ip v4
lsof -i 80 --> monitor trafik dengan port 80
of the two tools above have their own advantages and disadvantages, but for more detail you can see traffic using iftop, because there it is clearly written outgoing and incoming traffic and with port details.
untuk cara lain bisa menggunakan lsof, lsof sebenarnya digunakan untuk cek file mana saja yang sedang di open, tetapi bisa juga difungsikan untuk pengecekan trafik.