On Tue, 23 May 2023, Tom Reed wrote:
On Tue, May 23, 2023 at 08:24:10AM +0800, Tom Reed wrote:Sorry for my newbie question too. If I know the network addr: 192.168.1.0 And know the broadcast addr: 192.168.1.255 Then I should have the possibility to cal the netmask addr: 255.255.255.0 Isn't it?Not necessarily. PROBABLY yes, but you can't be certain. The netmask in this example could be either /23 or /24. Why are you asking these questions? What's your ACTUAL issue?IIRC, last year my ISP gives me 8 IPv4, they said the first is network addr, the last is broadcast addr, then I have to calculate the netmask by myself. regards.
It's almost certain that you could actually use all 8 addresses assuming that the reason for having them is to allow routing to/from the internet and you were connecting via ppp. I had a static /30 but could use all four addresses for hosting. Once it reached my ISP (via a /32 ppp address :-) ) it was part of a larger block. What I did was pretend I had a /28 - which meant if any of those 'hijacked' addresses around mine tried to connect they'd get no response. If you don't want to risk that then you can NAT the addresses into the middle of a rfc1918 range. That won't work if one of the addresses is the isp's router.