Dear all,


Can you explain me about subnetmask? how can I find the subnetmask and number of host?


Thank!

Dani AI

Generated

A short, practical follow-up that complements and : how to discover the mask configured on a host, verify the network and broadcast endpoints, and handle a couple of special cases you may not see in introductory explanations.

To see what a machine is actually using, run the platform commands below and inspect the interface lines for the address and the prefix or subnet-mask field. This is the fastest way to confirm what the OS thinks the local network is.

Windows:
ipconfig /all

macOS:
ifconfig
route get default

Linux:
ip addr show
ip route show

To derive the network and broadcast addresses from an IP and its mask: treat both as 32‑bit values, compute the network as the bitwise AND of IP and mask, and compute the broadcast as the network OR the bitwise NOT of the mask. The usable host range sits between those endpoints except in special cases. Tools such as ipcalc or sipcalc will do the math for you and output the network, broadcast, and usable range automatically.

Point-to-point links and single-host addresses behave differently. There is a standard that allows a two-address prefix to be used on point-to-point links, and a single-address prefix is used for host routes — consult RFC3021 for the /31 point-to-point rule. For private network planning, refer to the private address guidelines in RFC1918.

A few practical tips: confirm the gateway supplied by your ISP or host provider (as noted), document assigned addresses and the mask you chose, avoid overlapping subnets, and test connectivity to the gateway and other subnets after changes. If anything looks wrong, post the exact ipconfig/ip addr output (mask/prefix redacted if needed) so the community can help pinpoint the issue.

Recommended Answers

All 3 Replies

The subnet mask is something you can set depending on how large you want the network to be. Basically a translates to 11111111.11111111.11111111.00000000

Theres 24 1s and 8 0s. To figure out how many hosts you have raise 2 to the number of hosts. Then you subtract 2 for the network and broadcast address of that network. SO in this case, 2^8 = 256. 256-2 = 254. There you have 254 IPs to hand to devices. The more 0s you have in the mask, the more hosts per network. The more 1s you have, the more networks you can create.

Hello,

Your subnet mask should have been provided by your hosting server service provider. Basically what it does is determine how many IP addresses are on your local segment of the network so the system knows what addresses it must go out through the gateway to access. i.e. If you were assigned 8 Ip addresses (say through ) your subnet mask would be or
-


Here is a table which may help.

ID	# Bits	Number Hosts	Usable Hosts	Netmask		Note

6	/6  	67108864	67108862	 252.0.0.0  	

7	/7 	33554432	33554430	254.0.0.0 	

8	/8 	16777216	16777214	255.0.0.0 	Class A Network 

9	/9 	8388608		8388606		255.128.0.0 	

10	/10 	4194304		4194302		255.192.0.0 	

11	/11 	2097152		2097150		255.224.0.0 	

12	/12 	1048576		1048574		255.240.0.0 	

13	/13 	524288		524286		255.248.0.0 	

14	/14 	262144		262142		255.252.0.0 	

15	/15 	131072		131070		255.254.0.0 	

16	/16 	65536		65534		255.255.0.0 	Class B Network 

17	/17 	32768		32766		255.255.128.0 	

18	/18 	16384		16382		255.255.192.0 	

19	/19 	8192		8190		255.255.224.0 	

20	/20 	4096		4094		255.255.240.0 	

21	/21 	2048		2046		255.255.248.0 	

22	/22 	1024		1022		255.255.252.0 	

23	/23 	512		510		255.255.254.0 	

24	/24 	256		254		255.255.255.0 	Class C Network 

25	/25 	128		126		255.255.255.128 	

26	/26 	64		62		255.255.255.192 	

28	/28	16		14		255.255.255.240	

27	/27	32		30		255.255.255.224	

29	/29 	8		6		255.255.255.248 	

30	/30 	4		2		255.255.255.252

Thanks for your answer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.