I need to write a bash script that when I enter two ip addresses, it will calculate summarize address for them.
Examlpe:
192.168.1.27/25
192.168.1.129/25
Result will be:
192.168.1.0/24
Can you help me with this script?
I know you will say to me “What did you try?”
I tried to find something in Google, but what I found that I must to convert to binary then calculate it, and it will be very hard.
I even don’t know how to start with it.
Any idea or hint please?
Calculation of common netmask with bash:
Output: