Sub net mask won't stick

B

bof

I have a gateway router on 192.168.1.1 and a machine configured for
static IP 192.168.1.157.

When I set the subnet mask on the PC to 255.255.255.0 I can, as
expected, ping external IP addresses.

If I change the subnet mask to 255.255.255.128, as expected, I can no
longer ping external IP addresses.

If I disable and enable the adapter, or reboot the PC I can once again
ping external IP addresses, even though the IP configuration window, and
CMD prompt's ipconfig, shows the subnet mask as still being
255.255.255.128.

It seems to be consistent across a range of NICs, PCs, gateways and
network addresses, I've not been able to locate a reference to this
behaviour on the MS support pages.

Anyone know any more about what's going on here?
 
G

Gary

You do realize your default gateway has to be on your local subnet.
192.168.1.1 is not on your subnet if you change the subnet mask to
255.255.255.128
 
B

bof

Gary said:
You do realize your default gateway has to be on your local subnet.
192.168.1.1 is not on your subnet if you change the subnet mask to
255.255.255.128

Gary, thanks for the reply. Yes I do realise, that's the whole point of
the post really, when I first change to a .128 subnet it doesn't ping
through the gateway, /as expected/, if I disable and re-enable the NIC,
or re-boot the PC, I /can/ ping through the gateway even though it's on
a different subnet.
 
B

bof

Gary said:
Open a Command Prompt and type "Route Print" is anything pointing to the
192.168.1.1



Thanks I hadn't taken a look at that.

This is the route print /immediately after/ changing the net mask to
..128, when I can't ping external IPs as expected:


Active Routes:
Network Destination Netmask Gateway Interface
Metric
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.1.128 255.255.255.128 192.168.1.157 192.168.1.157 20
192.168.1.157 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.1.255 255.255.255.255 192.168.1.157 192.168.1.157 20
224.0.0.0 240.0.0.0 192.168.1.157 192.168.1.157 20
255.255.255.255 255.255.255.255 192.168.1.157 192.168.1.157 1
255.255.255.255 255.255.255.255 192.168.1.157 3 1
=========================================================================
==
Persistent Routes:
None





This is the route print /after/ disabling and then re-enabling the NIC
(no other change), when I can ping external IPs, where the PC appears
happy to route via .157 / .1 :

Active Routes:
Network Destination Netmask Gateway Interface
Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.157 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.1.128 255.255.255.128 192.168.1.157 192.168.1.157 20
192.168.1.157 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.1.255 255.255.255.255 192.168.1.157 192.168.1.157 20
224.0.0.0 240.0.0.0 192.168.1.157 192.168.1.157 20
255.255.255.255 255.255.255.255 192.168.1.157 192.168.1.157 1
255.255.255.255 255.255.255.255 192.168.1.157 3 1
Default Gateway: 192.168.1.1
=========================================================================
==
Persistent Routes:
None
 
P

Paul Mckenna

Are you also changing the subnet mask on your gateway as well?
If not then maybe (this is just my crazy notion) when you change the address
on the PC, the PC already knows which machine has 192.168.1.1 (ARP cache or
whatever it's called) and knows it can no longer talk to it but when you
disable and enable the network card your PC is sending out a broadcast
request for anyone knowing a route to 192.168.1.1 and because your gateway
is still on the /24 subnet it's hearing that request and saying well yeah
that's me what you shouting for? so your PC is like ok I can talk to
192.168.1.1 and creating a route to it.

This could of cause be total BS :)
 
G

Gary

This is why it is working
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.157 20

This entry says anything off my subnet gets routed to 192.168.1.1 using the
nic address.
 
B

bof

Gary said:
This is why it is working
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.157 20

This entry says anything off my subnet gets routed to 192.168.1.1 using the
nic address.

Yes I realise this, but why does that route get added at all when I
disable/enable the NIC or when I reboot the PC?

To my mind with a .128 mask the route shouldn't be there, as indeed it
isn't when I first change the mask from .0 to .128.
 
B

bof

Paul said:
Are you also changing the subnet mask on your gateway as well?
If not then maybe (this is just my crazy notion) when you change the
address on the PC, the PC already knows which machine has 192.168.1.1
(ARP cache or whatever it's called) and knows it can no longer talk to
it but when you disable and enable the network card your PC is sending
out a broadcast request for anyone knowing a route to 192.168.1.1 and
because your gateway is still on the /24 subnet it's hearing that
request and saying well yeah that's me what you shouting for? so your
PC is like ok I can talk to 192.168.1.1 and creating a route to it.

I don't think it's an ARP cache problem as the problem appears after a
reboot as well as after a NIC enable/disable.

The main issue to my mind is that the behaviour of the PC changes, it
has no route to 192.168.1.1 immediately after I've changed the mask to
..128, but does have one after a reboot or a NIC disable/enable. My
understanding is that with the .128 mask there should not be a route
from .157 to .1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top