First of all, I admit that when I started to answer this question, I didn’t even understand the problem. Checking the log is indeed an irresponsible answer. Here I will update my understanding of this question
My suggestion is also to use the netstat command. Manage netstat to see the effect of this command: "netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships"
Check which IPs the server has been connected to :
1. As far as TCP communication is concerned, I assume that you are asking about the connection through the three-way handshake. Then you can use this command to check the IP address:
This way you can find the established tcp communications and sort them from large to small by the number of links
2. If you are checking UDP communication, you don’t need to consider the status of TCP communication, just query directly:
First of all, I admit that when I started to answer this question, I didn’t even understand the problem. Checking the log is indeed an irresponsible answer. Here I will update my understanding of this question
My suggestion is also to use the netstat command. Manage netstat to see the effect of this command: "netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships"
Check which IPs the server has been connected to :
1. As far as TCP communication is concerned, I assume that you are asking about the connection through the three-way handshake. Then you can use this command to check the IP address:
This way you can find the established tcp communications and sort them from large to small by the number of links
2. If you are checking UDP communication, you don’t need to consider the status of TCP communication, just query directly:
man netstat
iptables can also record logs, but it doesn’t seem to be easy to filter.
nf_conntrack will record connections in the recent period:
But for the setting of its timeout, please see sysctl.conf