IP-address ending with zero? [closed]

2020-02-17 02:03发布

问题:


Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 7 years ago.

This might not be the right place or the right time, but I have a question. I'm a computer-engineer and I know a few things about networking, but when I saw (see pic), I WTF'ed.

Situation: I came home this Friday and was asked to help my dad with some network-problems. He sat up a few IP-Cameras a while ago, and I got it working from anywhere. But this week the ISP did some sort of "Reboot" or upgrade or what ever, and we got the IP shown on the picture. Now I'm not able to connect to these IP-Cams from an external IP.

Hypothesis: I'm guessing the ISP sat a subnet-mask with less than 24bits, but why would a ISP want to do this? And how come I can't connect to this IP?

Anyone have anything to say about the situation? I will most likely get a new IP if I just contact the ISP, but I thought I'd share this just for fun. I never expected to get such IP from an ISP :p

回答1:

An IP address ending in .0 is perfectly legal these days. However, some devices (and firewall policies) believe that it isn't.

In the old "classfull" addressing scheme, IPs from 192.0.0.0 to 223.255.255.255 were considered "class C" space, i.e. they had an implicit subnet mask of 255.255.255.0.

So, back then, you couldn't actually have a .0 host address, because .0 was the "network address". Similarly you couldn't have a .255 address within that range because that was the broadcast address.

About 20 years ago, though, everyone changed to "classless" CIDR style addressing, with variable length subnet masks, and no implicit subnet masks. If you've got a /23 then there shouldn't be any reason why you can't use the .255 that's at the end of the first /24 and the .0 that's at the start of the next.

However, 5+ years ago when I was in the ISP industry our system would happily give out .0 and .255 addresses to end users, but then we found that they couldn't reach Microsoft's websites because they had either broken kit, or overzealous firewall rules. We ended up having to exclude those addresses, even though they're legal.