derive host address from network #136
RubyTuesdayDONO
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
given a network and a host portion, is it possible for IPAddress to generate the full host address in that network? for example, if i've got an
IPAddress('1.1.1.0/24')
, can i ask it for the full address of a host whose host bits are123
(i.e.1.1.1.123
)?i searched various methods and did not see anything direct (yes, you can splice octets, but that only works reliably for
/8
,/16
, and/24
networks). there are useful applications in templating, e.g. "i'm planning IPs for a new network, and hosts of a given role always have the host bits123
, so please give me the full address of that host in this network"Beta Was this translation helpful? Give feedback.
All reactions