The routing table of a router is shown below:
Destination Sub net mask Interface 184.108.40.206 255.255.255.0 Eth0 220.127.116.11 255.255.255.128 Eth1 18.104.22.168 255.255.255.255 Eth3 default Eth2
On which interfaces will the router forward packets addressed to destinations 22.214.171.124 and 126.96.36.199 respectively?
(A) Eth1 and Eth2
(B) Eth0 and Eth2
(C) Eth0 and Eth3
(D) Eth1 and Eth3
Explanation: To find the interface, we need to do AND of incoming IP address and Subnet mask. Compare the result of AND with the destination. Note that if there is a match between multiple Destinations, then we need to select the destination with longest length subnet mask.
188.8.131.52, matches with 184.108.40.206 and 220.127.116.11, the packet is forwarded to Eth1 as length of subnet mask in Eth11 is more.
If a result is not matching with any of the given destinations then the packet is forwarded to the default interface (here Eth2). Therefore the packet’s addressed to 18.104.22.168 will be forwarded to Eth2.
Quiz of this Question