'How to check opened network routes/ports between two servers / instances efficiently / at scale?

I'm struggled to verify if network rules are properly opened between multiple servers. I have a lot of instances to check, these instances contain multiple services using massivley ports for communication (a fork of Hadoop). So typically I have Hadoop, Zoo Keeper, Elastic, SolR, Nomad, Mongo DB, other databases, etc. Due to fault tolerance architecure these services could be started on most of the nodes.

As part of my job I need to check if network rules are correct to avoid failures and as you could imagine it becomes hard when you have plenty of open ports across many clusters (clusters are not ISO unfortunately).

I use some commands from the instances like 'telnet', 'wget', 'ping' 'netstat' to check the connections. This is really manual and time consuming. Is there a program / existing solution designed to technically test opened routes between Linux platforms (actually we are using AWS EC2 instances with RHEL).

The thing is not to brute force the instances and get the list of opened routes between the machine. This is more like a tool where I could specify a list of ports to be verified in order to avoid creating my own Shell script. Please note we could use root privilleges on each instance. Something like a list of checking rules to be defined between two instances I could replay later on.

Kind regards,



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source