Please help me understand IP4 address and subnet mask and subnetting


It will be really helpful if you guys guide to good source for understanding.
IP4 addresses
Subnet Mask
and subnetting.
It is so confusing.
Please if possible post a link.

Thank you,

To be honest a forum post to replace a web search for such a basic topic might not be the best

The first entry there looks like a good starting point


sorry :slightly_frowning_face:
i find it really confusing that's why asked here

@neil1 If you have a particular question then it would make sense to post it (though that's probably more suited for a general network forum not a specific forum like this one).


Anyway, a typical home router would use IP address like with subnet mask of Valid IP addresses for this network world be from to

If you have another network (for example a parent router and a child router, or several VLANs on the same router), then you can use addresses from to for the second network.

That should get you by for a typical setup. If you want more complicated setup, you will have to do some reading.


Hi @neil1,

I am a confused noob too. This readymade calculator helped me to understand a few things.

Hope this helps you.

Thank you!


I want to ask about DHCP lease and static ip
DHCP range is from
buy my router ip is
how my router is still working?
I have a printer and two access points. But i dont see them in connected devices.
they have static IPs.
Should i add them as static dhcp lease in the openwrt settings?
to see them in connected devices and what IPs i should assign them?

Static IPs (means static configured on the client device) will not be shown on the DHCP server

Yes it would be better to configure a static lease for them and then put them on DHCP so that they receive the same IP you before had configured statically on them


one more question.
DHCP lease range is from
and i have assigned static IPs to devices but these IP addresses are outside DHCP lease range.
What if i remove static IP settings from those devices?
Will these devices be getting the static IP i assigned them or they will get a IP from DHCP lease range?

The lease range is only for dynamically assigned IP's so if the devices you are assigning IP statically are outside this range they still get it from the DHCP server.


I have a printer with static IP in printer settings
and DHCP lease range is 192.168.100-
I like to setup IP for printer in the router DHCP settings.
Printer will get from DHCP assigned as static lease or from DHCP lease range?
sorry for asking same question again.

That is correct just assign to the MAC address of the printer in static leases and then configure the printer to use DHCP and everything is as before.


If you mean the default DHCP range for OpenWrt then it's to The numbers you see 100 is the beginning of DHCP pool and the 150 is the range of the pool, or the number of the addresses.

People will have different opinions about that. Personally I set static IP for network devices (e.g. routers and APs) so they are always accessible via the same IP even if they are not connected to the main router, and set static leases for the rest of my devices (e.g. PCs and printers).

But you could also have the printer as static IP if it allows that. It's good practice though to arrange the static IPs of your devices and leave room for future expansion. For example, reserve to for routers, to for printers, etc.


OK thank you. It is working.
Printer got the IP as assigned in static lease.
What is the good practice? Assign static IP in the dhcp lease range or outside lease range.
And should i assign static IP addresses to my WiFi access points too? in openwrt static leases


If they are manageable via the IP Address then that makes sense.
I would use Static Leases for any device that offer services in your LAN or for which you want to give specific Firewall rules


why it doesn't start from to
because subnet mask is
you can use all addresses in this range from 0 to 255?

It doesn't start at so that you can use the addresses below 100 for the static leases

1 Like

oh :thinking: ok that's nice! thanks for telling this. I will keep it in mind.
that's why routers always have dhcp lease range set as - or 150.
and one more question why ip range is from 0-255 why not 0-999 or something like that. I know it has something to do with 8 bit size but why not go 9-10 or even more big or small bit size for it? Why only 8 bit size.

That's just the commonly used 'default' size for a LAN. You can go bigger or smaller depending on your own requirements. But for most domestic/small business networks you don't really need more than 254 available addresses.

what if i need 500 addresses?
then what should i do?
divide them in 2 routers with 254 addresses each?
what if i need them on same network?