What is a default gateway?
To understand a default gateway, look at how a host identifies its local network, neighbours and route to other networks. IPv4 depends on the address, prefix length and gateway; IPv6 also depends on address scope and Neighbor Discovery. One wrong value can leave local communication working while breaking access beyond the subnet.
How to check the network settings
Start with the interface address, prefix, routing table and default gateway. Check whether the destination belongs to the local prefix and whether a default route exists. Do not change a mask or gateway by guesswork; compare it with DHCP or network documentation and repeat the same test after one controlled change.
The detail that matters
The default gateway is used when no more-specific route matches a destination. It normally has an address reachable on a directly connected local network; pointing the default route at an unreachable gateway cannot be repaired by changing DNS because packets never reach the resolver path. For a calculation you can compare with the explanation above, use 2ip IP calculator.