K
K
Kirill Petrov2014-10-15 12:17:32
Computer networks
Kirill Petrov, 2014-10-15 12:17:32

How to convert a bunch of ip addresses to their masks?

You need to convert a bunch of ip like

54.55.218.253
55.75.3.121
16.75.188.157
17.148.174.154
8.99.137.112
88.118.71.79
608.16.71.86


in kind
54.55.218.0/32
55.75.3.0/32
16.75.188.0/16
17.148.174.032
8.99.137.0/24

And so on, so as not to shove a bunch of IP addresses, but purely by ranges. Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrew, 2014-10-15
@OLS

Do you have classfull addresses ?

T
throughtheether, 2014-10-15
@throughtheether

Let's start with the fact that the example is not quite correct. In particular, the address 54.55.218.253 is included in the prefix ("subnet" in jargon) 54.55.218.0/24, but not 54.55.218.0/32.
To help you, you need to know what these addresses are, how many there are in total, whether there are "neighbors" among them (for example, 54.55.218.253 and 54.55.218.254) and how they will be used (rules in iptables?).
Generally speaking, the summarization/aggregation of addresses (prefixes) can help you, but, on the other hand, it may turn out that there will be no point in it.

V
Valentin, 2014-10-15
@vvpoloskin

Probably the subnet mask was invented just like that. Nafig it is generally needed if you can immediately get the network directly from the IP address.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question