Routing and Switching Interview Questions

The following routing and switching interview questions from the below Ebook.

When is a static route configured on a router.

Assume that the router 1 has two network cards. The network cards are configured with the IP address 192.168.1.1 and 192.168.2.1 with the subnet masks 255.255.255.0. When this is configured on the router, the networks 192.168.1.0 and 192.168.2.0 would be highlighted as directly connected networks on the routing table of the router. Assume that router 2 is directly connected to router 1. Router 2 has one of the interface cards configured with the IP address 192.168.3.1 and subnet mask 255.255.255.0. This would populate the route entry 192.168.3.0 on router 2. A static route for 192.168.3.0 will be configured on Router 1 and static routes for 192.168.1.0 and 192.168.2.0 configured on router 2 for communication. Static routes are configured on routers for networks which are not directly connected or the router is unaware of.

What is required for intervlan communication.

Assume that two PC’s are connected to port 2 and port 3 of a switch which are members of vlan 2 and vlan 3 respectively and the PC’s are required to communicate with each other. If the switch is layer 2, a router would be required for intervlan communication. If the switch is layer 3, the routing process can be configured on the switch.

How many broadcast domains are there on a 24 port switch and a 24 port hub

A broadcast domain is the area on which a broadcast traffic from one device would be received by other devices. A switch and a hub contains one broadcast domain. Consider the following scenarios. When a PC is connected to a hub, and it sends broadcast traffic, the data is sent out to all ports on the hub. When the PC is connected to a switch and it sends broadcast traffic, it is also send to all ports on the switch. In hubs, irrespective of whether the traffic is broadcast or unicast, it is sent to all ports, because hubs don’t understand the type of traffic but just signals. On a switch, when a broadcast traffic is received (frame with mac-address value as FF-FF-FF-FF-FF-FF), it understands that the frame has to be broadcasted and would be sent to all ports.

What is the difference between default route and default gateway.

A default route is a route entry in a routing table whereas a default gateway is a value, typically an IP address. When an IP packet is received by a router, it looks into the destination IP address in the packet. It then checks in its routing table if it is aware of the network address corresponding to the IP packet. It would then forward the packet out on the required interface to which the network is connected. If the destination network is unknown, the packet would be dropped. What if the router is directly connected to another router, which knows about the destination network in the IP packet. In this scenario, two options can be configured. The default gateway of the first router can be configured with the IP address of the second router. When this configuration is performed, a route entry would be automatically populated in the routing table. This route entry is known as a default route. Instead of configuring the default gateway, a default route entry can also be configured directly on the router.

How does routing work

Take a scenario where two PC’s are connected to a switch. The IP address of PC1 and PC2 is 192.168.1.2 and 192.168.1.3 respectively. The subnet masks of the PC’s are 255.255.255.0. From the IP address and subnet mask , the network address is 192.168.1.0. This implies that both the PC’s reside on the same network. If PC1 wishes to communicate with PC2, an additional device like a router is not required, since both the devices reside on the same network. Consider the above scenario where the IP address of PC1 and PC2 is 192.168.1.2 and 192.168.2.2 respectively. The subnet mask for both the PC’s are 255.255.255.0. The network address of PC1 and PC2 is 192.168.1.0 and 192.168.2.0 respectively. This implies that both the PC’s are on different networks. If PC1 needs to send data to PC2, the IP packet carrying the data has to be sent through a device which is capable of understanding different networks like a router. This process is termed as routing. In the first case, the switch does not understand the concept of different networks since basically a switch works at layer 2 of the OSI model whereas routers work at layer 3 of the OSI model.

Which connection would be used on a PC with two internet connections

Assume that a PC has two internet connections. The LAN adapter of the PC is connected via the internet router of the organization. The PC also has a internet data card which is also connected to the internet. In effect, there are two connections to the internet. If a user on the PC , attempts to open the URL http://www.tcpipguru.com, which connection would be taken. Obviously two connections cannot be used at the same time to send a single request. The PC would refer it’s routing table. Since both the cards have access to the internet, there would be two default route entries in the routing table of the PC. The card which is associated with the lower metric value in the routing table would be chosen for sending the traffic to the internet. What if the user wants that the internet traffic should be send only through the LAN adapter ? The user could then update the corresponding routing entry with a lower metric value than the data card adapter.

Buy the Ebook from Amazon for questions and answers on Routing & Switching