Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9129719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:48:46+00:00 2026-06-17T07:48:46+00:00

I am questioning the results of the ipcalc module ( ipcalc ) for Python

  • 0

I am questioning the results of the ipcalc module (ipcalc) for Python (it seems that netaddr may be a better choice).

Let’s take 192.168.1.25/30 as an example. In binary, the last octet is 00011001 AND 11111100 = 00011000, so I get 192.168.1.24 as the Network ID and the range 192.168.1.24 - 192.168.1.27.

Using ipcalc, when I specify

subnet = ipcalc.Network('192.168.1.25/30')
for x in subnet: print x

The output is

192.168.1.25
192.168.1.26
192.168.1.27
192.168.1.28

I am not understanding the inconsistency. When using CIDR notation, it seems that specifying both 192.168.1.24/30 and 192.168.1.25/30 (or .26/30 or .27/30) refer to the same subnet.

Is that correct? Is this just a bug in the ipcalc module?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:48:47+00:00Added an answer on June 17, 2026 at 7:48 am

    There is an open bug for this at the moment: No way to resolve IP + Netmask to Network Object

    And an earlier bug report that discuss the matter: Strange subnet calculations


    But they have also added a function called network to get the network address from an IP. From the manual:

    >>> localnet = Network('127.128.99.3/8')
    >>> print localnet.network()
    127.0.0.0
    

    The manual specifically says that the constructor Network should take a network address as its first argument, not any IP in the network. Rather confusing if you ask me (especially since the above code block breaks that condition). I would at least read the code for the module before using it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say that i have a variable questionId which is an integer, and i
I often find myself questioning whether I'm taking the right approach in trying to
i have four tables user-question contains two columns: questionID, userID, the questions that the
i have a query that returns rows that i want, e.g. QuestionID QuestionTitle UpVotes
Here is some CRTP based template code that I used to try and resolve
I am trying to graph the results of a survey, where the question is
My output does not insert the data for Total Marks correctly, it seems like
Here's a problem that I seem to be running into working with an accounting
I encountered a bit of code within the book I've been reading that has
I'm storing results from a quiz in a table, and I need to find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.