-3

Our hoster has assigned us multiple public IP addresses. They are individual non-contiguous addresses e.g. 1.1.1.50 and 1.1.1.222. According to them the correct subnet mask to use is 255.255.255.0.

I do not understand why that is. My understanding is that the subnet mask is supposed to designate which addresses are considered part of the local network. But these are individual public IP addresses. There is no local network or subnet associated with them.

In my opinion the mask should be 255.255.255.255. What difference does this make?

closed as off-topic by Greg Askew, womble Sep 28 '18 at 22:28

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    You are probably not privy to the details of how your hoster has set up their local network. How, then, can you know what the correct netmask is? There are many ways this might be done, and only some of them will result in a point to point /32 that you seem to be expecting. – Michael Hampton Sep 28 '18 at 17:29
  • @MichaelHampton I do not question their information at all and will do as they tell me. But I want to understand what's going on. I wonder why the question was downvoted. – boot4life Sep 28 '18 at 17:32
  • Why would you say these IP addresses are "individual"? The ISP probably has a network of which you are given two IP addresses to use. I assume your ISP also gave you a default gateway to use, another indication that your two IP addresses are part of a "local network". – Tommiie Sep 28 '18 at 17:34
  • Yes, surely the entire C block is in use somehow. But from the point of view of my own server none of the other addresses seem to matter for routing (in my understanding). – boot4life Sep 28 '18 at 17:46
  • I'm voting to close this question as off-topic because if you want to know how your ISP has configured their network, you should ask them. – womble Sep 28 '18 at 22:28
3

The difference is that your ISP has an assigned IP range of 254 addresses (or maybe more than one but this is the subnet you are in). Every ISP has that. This differenciates his subnet from those of other ISPs. Imagine the internet as just a network like every other.

Plus you always need a gateway, too because without it you would be the only member of this subnet with no one to communicate with.

In reality subnets smaller than /30 cannot be used in the internet because you need minimum 4 addresses per subnet: 1) network address 2) gateway 3) host 4) broadcast

  • Can you clarify one thing for me... What negative consequences does it have if I configure the wrong subnet mask? I do not see what effect the mask has in my case. – boot4life Sep 28 '18 at 16:59
  • Because your default gateway needs to reside in the same subnet as your local interface. If you set a /32 (255.255.255.255) mask, your gateway will be unreachable. It's just how IP works. – guzzijason Sep 28 '18 at 17:27
  • Also, if you configure the wrong mask, then your other host(s) that are in the same subnet will no longer be directly reachable - your host will try to route through a gateway to get to them instead of simply talking to them directly. – guzzijason Sep 28 '18 at 17:29
  • Why would you configure a subnet mask other than the one provided to you by your ISP? – Tommiie Sep 28 '18 at 17:30
  • The default gateway being unreachable is a good point. Besides that, is it fair to say that the subnet mask does not matter if there is only one NIC? Then, all traffic will go to that NIC because the default gateway is on that NIC. – boot4life Sep 28 '18 at 17:30
0

The subnet mask advised by your hoster says that they're using /24 networks. The one you're saying shouldn't be the netmask can't be because that's the broadcast address (the first and last address of a network are not used).

  • I thought this 255.255.255.255 would mean that the subnet consists of just this one IP address, no? – boot4life Sep 28 '18 at 16:59
  • Right, and a network of a single host is not really a network at all. – guzzijason Sep 28 '18 at 17:30
  • @boot4life, No. All bits to cero means that's the network address and all bits set to 1 means it's the broadcast address. – Humberto Castellon Sep 28 '18 at 17:31
-1

If you don't have a mask assigned (larger than /32), you can't route traffic to/from it. IIRC, some ISPs like Verizon often give you IPs with a /24 mask, because the GW is somewhere in their CO as opposed to your location.

Not the answer you're looking for? Browse other questions tagged or ask your own question.