Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #258620

Re: netmask question

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: netmask question
Date 2023-05-23 02:10 +0200
Message-ID <GynLb-aLQd-5@gated-at.bofh.it> (permalink)
References (1 earlier) <Gy5Oh-aAZD-1@gated-at.bofh.it> <Gy8j7-aCxQ-1@gated-at.bofh.it> <Gygql-aHpq-1@gated-at.bofh.it> <Gyj4R-aJ3P-7@gated-at.bofh.it> <GynrP-aLuC-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 23, 2023 at 07:39:21AM +0800, Tom Reed wrote:
> For a given ipv4, if I know net addr and broadcast addr, how will I
> calculate the netmask?

I hope this is a theoretical question, because this is backwards.
Normally you would specify the IP address and the netmask, and the
software would calculate a broadcast address for you.

The question you asked has no unique solution in the general case.
Consider that you have the IPv4 address 10.0.255.42 and the broadcast
address 10.0.255.255.

Now, the netmask *could* be /24.  That would make 10.0.255.* the network
address, and setting all the non-network bits to 1 gives you the
broadcast address 10.0.255.255.

But the netmask could also be /22.  That would make the network
address range 10.0.252.0 through 10.0.255.255.

In fact, the netmask could be anything from /17 to /24 inclusive.  You
can't deduce it from the available information.

That's why you specify the netmask up front.  You have to know it.

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

netmask question coreyh@free.fr - 2023-05-22 04:50 +0200
  Re: netmask question Timothy M Butterworth <timothy.m.butterworth@gmail.com> - 2023-05-22 05:00 +0200
    Re: netmask question Tim Woodall <debianuser@woodall.me.uk> - 2023-05-22 09:50 +0200
      Re: netmask question <tomas@tuxteam.de> - 2023-05-22 10:10 +0200
      Re: netmask question coreyh@free.fr - 2023-05-22 11:00 +0200
        Re: netmask question Tim Woodall <debianuser@woodall.me.uk> - 2023-05-22 11:10 +0200
          Re: netmask question coreyh@free.fr - 2023-05-22 12:20 +0200
            Re: netmask question Timothy M Butterworth <timothy.m.butterworth@gmail.com> - 2023-05-22 12:30 +0200
            Re: netmask question Dan Ritter <dsr@randomstring.org> - 2023-05-22 13:10 +0200
      Re: netmask question Timothy M Butterworth <timothy.m.butterworth@gmail.com> - 2023-05-22 12:20 +0200
        Re: netmask question Tim Woodall <debianuser@woodall.me.uk> - 2023-05-22 12:30 +0200
        Re: netmask question <tomas@tuxteam.de> - 2023-05-22 13:10 +0200
  Re: netmask question Charles Curley <charlescurley@charlescurley.com> - 2023-05-22 05:10 +0200
  Re: netmask question <tomas@tuxteam.de> - 2023-05-22 07:00 +0200
    Re: netmask question Tim Woodall <debianuser@woodall.me.uk> - 2023-05-22 09:40 +0200
      Re: netmask question <tomas@tuxteam.de> - 2023-05-22 10:00 +0200
      Re: netmask question Timothy M Butterworth <timothy.m.butterworth@gmail.com> - 2023-05-22 12:20 +0200
      Re: netmask question gene heskett <gheskett@shentel.net> - 2023-05-22 18:20 +0200
        Re: netmask question <tomas@tuxteam.de> - 2023-05-22 21:10 +0200
          Re: netmask question gene heskett <gheskett@shentel.net> - 2023-05-23 01:50 +0200
            Re: netmask question Dan Purgert <dan@djph.net> - 2023-05-23 03:20 +0200
              Re: netmask question debian-user@howorth.org.uk - 2023-05-23 12:50 +0200
                Re: netmask question Dan Purgert <dan@djph.net> - 2023-05-23 14:20 +0200
            Re: netmask question tomas@tuxteam.de - 2023-05-23 07:00 +0200
          Re: netmask question "Tom Reed" <tom@dkinbox.com> - 2023-05-23 01:50 +0200
            Re: netmask question Greg Wooledge <greg@wooledge.org> - 2023-05-23 02:10 +0200
              Re: netmask question <tomas@tuxteam.de> - 2023-05-23 06:40 +0200
            Re: netmask question Dan Ritter <dsr@randomstring.org> - 2023-05-23 02:30 +0200
              Re: netmask question "Tom Reed" <tom@dkinbox.com> - 2023-05-23 02:30 +0200
                Re: netmask question Dan Ritter <dsr@randomstring.org> - 2023-05-23 02:50 +0200
                Re: netmask question <tomas@tuxteam.de> - 2023-05-23 06:50 +0200
                Re: netmask question Andy Smith <andy@strugglers.net> - 2023-05-27 03:10 +0200
                Re: netmask question Greg Wooledge <greg@wooledge.org> - 2023-05-27 03:10 +0200
                Re: netmask question Andy Smith <andy@strugglers.net> - 2023-05-27 03:20 +0200
                Re: netmask question Greg Wooledge <greg@wooledge.org> - 2023-05-23 02:50 +0200
                Re: netmask question "Tom Reed" <tom@dkinbox.com> - 2023-05-23 03:00 +0200
                Re: netmask question Dan Ritter <dsr@randomstring.org> - 2023-05-23 03:20 +0200
                Re: netmask question Tim Woodall <debianuser@woodall.me.uk> - 2023-05-23 08:30 +0200
                Re: netmask question Timothy M Butterworth <timothy.m.butterworth@gmail.com> - 2023-05-23 02:50 +0200

csiph-web