# Networking: Two hosts on one LAN can't talk — subnet mask or network address mismatch

**Code:** `Wrong subnet mask: hosts can't reach each other` · **Category:** Networking · **Seen on:** Linux, Windows, Networking

The hosts disagree about which addresses are local, so one tries to route traffic that should go straight across the LAN.

## Meaning

With 192.168.1.10/24 and 192.168.1.200/25 they compute different local networks. Use the same mask on every host, check DHCP-provided masks, and compare with `ip addr` / `ipconfig`. A /16 on one side and /24 on the other often causes one-way connectivity.

## Common causes

- Manually entered wrong mask
- Different DHCP scopes on one segment
- Overlapping subnets (/24 vs /25)
- Gateway outside the host's subnet
- Typo in the third octet

## Quick fix

1. Compare `ip -4 addr` / `ipconfig` on both hosts
2. Use one consistent mask and gateway in the subnet
3. Check the DHCP scope options

## Detailed fix by platform

### Linux

1. `ip -4 addr show eth0; ip route; ipcalc 192.168.1.200/25`

## How to diagnose

1. **Mask** — Same on both?
2. **Gateway** — Inside subnet?
3. **DHCP** — One scope?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/networking/subnet-mask-mismatch-wrong-subnet)
