We have an ideal way to analyse the traffic (egress) from our instance to make our infrastructure cost free. especialy in cloud. Cloud providers charges an amount based on the region and zone.
sudo apt-get update sudo apt-get install tcpdump sudo apt-get install whois
sudo tcpdump -i eth0 -c 10000 -w /tmp/nw.cap
sudo tcpdump -nr /tmp/nw.cap | awk '{print }' | grep -oE '[0-9]{1,}.[0-9]{1,}.[0-9]{1,}.[0-9]{1,}' | sort | uniq -c | sort -n
whois xxx.xxx.xxx.xxx