edited by
19,656 views
63 votes
63 votes

Host $X$ has $IP$ address $192.168.1.97$ and is connected through two routers $R1$ and $R2$ to an­other host $Y$ with $IP$ address $192.168.1.80$. Router $R1$ has $IP$ addresses $192.168.1.135$ and $192.168.1.110$. $R2$ has $IP$ addresses $192.168.1.67$ and $192.168.1.155$. The netmask used in the network is $255.255.255.224$.

Which $IP$ address should $X$ configure its gateway as?

  1. $192.168.1.67$
  2. $192.168.1.110$
  3. $192.168.1.135$
  4. $192.168.1.155$
edited by

3 Answers

Best answer
76 votes
76 votes

$X$ must be able to reach the gateway using the net mask.
Subnet number of host $X = 192.168.1.97 \;\&\; 255.255.255.224 = 192.168.1.96$

Now, the gateway must also have the same subnet number. Lets take $\text{IP}\;192.168.1.110$ of $R1. \; 192.168.1.110 \;\&\; 255.255.255.224 = 192.168.1.96$ and hence this can be used by $X$. 

$($To quickly identify the matching mask divide the last part of mask $(224\;\text{here})$ into powers of $2$. So, $224 = 128 + 64+ 32$. Now, our host $X$ has $97$ as the last part of $\text{IP} = 64 + 32 + 1$. So, the last part of subnet number becomes $64 +32 = 96$. Now, we need to consider only those $\text{IPs}$ whose last part will contain $64$ as well as $32)$

http://courses.washington.edu/css432/joemcc/slides/03_cidr.ppt
Correct Answer: $B$

edited by
11 votes
11 votes
The concept for this question and all other questions like this is as follows.

The router takes 1 IP address for every interface that it is connected to and the IP address is taken from the same subnet in which the whole network on that interface is.

So here every router is connected to 2 interfaces. Like R1 on the one side is connected to X and on the other side connected to R2. So similarly R2 is connected to R1 and Y.

So both the routers will be having 2 IP addresses. Both IPs in the interface should be in the same network.
So one side of the wire is X and on the second side is R2, So The default gateway for X will be the Ip address that belongs to the same subnet out of 2 IP which R1 has.
So you can get the Ip address router is using on the X side, remaining will be used to communicate by R2. Similarly, R2 has 2 IPs, check which is in the same subnet with the remaining IP of R1.
7 votes
7 votes
Network mask:255.255.255.224
Subnet bit =3 bit
For: 192.168.1.97
Network address = 192.168.1.01100000 =>192.168.1.96
For:192.168.1.110
Network address=192.168.1.01101110
=>192.168.1.96
Answer:

Related questions

54 votes
54 votes
8 answers
1
Ishrat Jahan asked Oct 29, 2014
11,793 views
Host $X$ has IP address $192.168.1.97$ and is connected through two routers $R1$ and $R2$ to an­other host $Y$ with IP address $192.168.1.80$. Router $R1$ has IP address...