SUBNET MASK
- Think of IP address as your house number in a big city.
- The subnet mask decides which part of the IP is the “area/street” and which part is the “house number”.
Example:
IP Address: 192.168.1.25
Subnet Mask: 255.255.255.0
255means “fixed area” (network part).0means “house number can change” (host part).
So here:
192.168.1= Network (street).25= Host (house)
With 255.255.255.0, you can have 254 devices (from .1 to .254) in that network.
DEFAULT GATEWAY
- The default gateway is like the main gate of your colony.
- Inside the colony, houses talk directly.
- But if you want to go outside the colony (different network), you need to go through the main gate (router).
Example:
- Your PC:
192.168.1.25 - Friend’s PC (same network):
192.168.1.50→ talk directly. - Want to reach Google (
142.250.183.206)?
→ Your PC sends data to the default gateway (e.g., 192.168.1.1),
→ The gateway then takes it outside to the internet.
In short:
- Subnet Mask = Splits the IP into network part vs device part.
- Default Gateway = The exit point (router IP) to talk to outside networks (like the internet).
Categories: