I'm studying for a test and found myself in a "dead end" with a question about netmasks.
The question is:
Based on the next figure, once both sub-nets are configured, it's observed that hosts in a sub-net can't access hosts in the other sub-net. The IP's for each station and for the router are: Station 01: 172.16.78.192 Station 02: 172.16.74.3 Station 03: 172.16.94.3 Station 04: 172.16.82.254 Router's port 01: 172.16.65.1 Router's port 02: 172.16.88.1 Figure: [Station 01]-------------------------------[Station 02] | | port 01 [Router] | port 02 | [Station 03]--------------------------------[Station 04] This problem is caused because of the netmask that was chosen. Which of the following netmasks will allow all hosts to communicate in a correct form? a) 255.255.240.0 ---- **This is marked as the correct answer in the book** b) 255.255.248.0 c) 255.255.252.0 d) 255.255.224.0 ---- **This is what I think is the correct answer** e) 255.255.232.0
Why I think 255.255.224.0
is the correct one?
Router's port 01: 172.16.65.1 Router's port 02: 172.16.88.1 I know the netmask will end as 255.255.X.0, so transforming the ports IP's to binary: Port 01: 0 1 0 0 0 0 0 1 . 0 0 0 0 0 0 0 0 = 65.0 Port 02: 0 1 0 1 1 0 0 0 . 0 0 0 0 0 0 0 0 = 88.0
For all the hosts to be able to communicate with each other, they must be in the same network, right?
So, if the mask is 255.255.224.0, we have the last 2 bytes as:
1 1 1 0 0 0 0 0 . 0 0 0 0 0 0 0 0 = 224. 0 And doing an AND with the Router's port: NET | HOSTS Port 01: 0 1 0 | 0 0 0 0 1 . 0 0 0 0 0 0 0 0 = 65 . 0 Port 02: 0 1 0 | 1 1 0 0 0 . 0 0 0 0 0 0 0 0 = 88 . 0 Netmask: 1 1 1 | 0 0 0 0 0 . 0 0 0 0 0 0 0 0 = 224 . 0 Resulting in: 0 1 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0 = 64. 0
All hots will be in the network: 172.16.64.0
, being able to communicate with each other.
Is that correct?
Or the correct netmask would really need to be 255.255.240.0
and if so, why is that? I can't seem to understand that.
Thanks everyone!