netstat -tn 2>/dev/null

Useful link:

https://www.mkyong.com/linux/list-all-ip-addresses-connected-to-your-server/