In this Cisco CCNA tutorial, you’ll learn about the basic operation of routers and how they compare to switches. Scroll down for the video and also the text tutorial.
Cisco Routers Video Tutorial
Kavin NK
Hi Neil, I enrolled in the CCNA course instructed by you and prepared for the exam through your lectures. I took my exam today and passed with a score of 878. Thank you for the lecture, lab and guidelines for the exam!
Routers
Routers route. That's why they're called routers. What that means is that they can direct traffic between your different IP subnets. They're required to do that. To be able to route traffic from one IP subnet to another, you're going to need a router to be able to do that.
They route traffic between our different IP subnets. IP is at Layer 3 of the OSI stack. So a router operates at Layer 3 of the OSI model. Obviously, it has physical interfaces on there as well. So, it's also operating at Layer 1. It also needs to understand Layer 2 addresses, so it also operates at Layer 2 as well.
Routers, actually, will normally be aware up to Layer 7 for advanced functions as well. But when they're doing the job of routing between different IP subnets, they're operating at Layer 3. So routers are termed as a Layer 3 device.
Routers vs Switches
To compare them with switches, routers are Layer 3 aware and can route traffic between different networks. Switches are Layer 2 aware, they're not Layer 3 aware, and can switch traffic between hosts on the Local Area Network.
Routers support many different types of interfaces such as Ethernet, Serial, ISDN, and ADSL. Switches will typically only support Ethernet interfaces. Switches will typically have a lot more ports than routers, and switches forward broadcast traffic. Routers don't forward broadcast traffic by default.
Routers support many more different types of ports than switches, and they'll usually have less available ports than switches. Cisco Catalyst 2960 Switch have 48 ports. So it had 48 ports plus some uplinks on there, and they were all Ethernet ports.
A Cisco 2800 series router only got two built-in Ethernet ports. You see there are four ports there, but one of them is a console port, and another one is an auxiliary port. So it only comes with two Ethernet ports compared to our 48 port switch.
If you look to the right of those ports, you see that there are modular slots there. So we can buy different types of interfaces, such as ADSL, Ethernet, serial ports, etc., and we can put them into the router.
Switch Operation
Okay, moving on. Let's have a quick recap of the switch operation. In the diagram here, you can see we've got a building. We've got a couple of switches in there. All our hosts are on the 10.10.10.0/24 network. When that's the case, they can all communicate with each other through our switches.
When they're all in the same IP subnet, there's no need to have a router there. But if one of those hosts had the IP address 10.10.11.10/24, it's now on a different IP subnet. It's not going to be able to communicate with the other hosts on the 10.10.10 network if we only have switches there.
Router Operation
It's in another Layer 3 network, so we need a Layer 3 device, a router, to be able to route traffic between those hosts. So, we put a router into the infrastructure. Now, it's aware of the 10.10.10 and the 10.10.11 networks. It's going to be able to route traffic between all the hosts on the network now.
Layer 3 Switches
Okay, one other thing to tell you about here is that you can get advanced switches which are Layer 3 aware. It can route traffic between different IP subnets. When you get one of those Layer 3 aware switches, it's known as a Layer 3 switch.
It still has a lot of characteristics that are similar to a normal switch though, it will typically only support Ethernet interfaces, and it will usually have more ports than routers.
Layer 3 Switch Operation
So, looking at our diagram again. Now, you see that we only have switches in the network infrastructure, but the switch at the bottom is a Layer 3 switch. Meaning, it is Layer 3 aware. It's aware of the 10.10.10 network and the 10.10.11 network, and it's able to route traffic between them.
Now, you can actually do this on a Catalyst 2960 like you saw earlier. Again, way back in the day, Layer 3 switches were expensive, but they've come down in price now. So it is very common to have Layer 3 switches routing the traffic, which is within the different subnets on your own Local Area Network.
However, if your connection outside that campus, out to the Wide Area Network, is using an interface type which is not Ethernet, then you would still require a normal traditional router for that traffic as well.
Cisco Routers Configuration Example
This configuration example is taken from my free ‘Cisco CCNA Lab Guide’ which includes over 350 pages of lab exercises and full instructions to set up the lab for free on your laptop.
Click here to download your free Cisco CCNA Lab Guide.
- View the routing table on R1. What routes are present and why?
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.10.10.0/24 is directly connected, GigabitEthernet0/0
L 10.10.10.1/32 is directly connected, GigabitEthernet0/0
The router has a connected route for the 10.10.10.0/24 network and a local route for 10.10.10.1/32. These routes were automatically created when the IP address 10.10.10.1/24 was configured on interface GigabitEthernet0/0
2. Configure IP address 10.10.20.1/24 on interface GigabitEthernet0/1
R1(config)#interface GigabitEthernet 0/1
R1(config-if)#ip address 10.10.20.1 255.255.255.0
R1(config-if)#no shutdown
3. What routes are in the routing table now?
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.10.10.0/24 is directly connected, GigabitEthernet0/0
L 10.10.10.1/32 is directly connected, GigabitEthernet0/0
C 10.10.20.0/24 is directly connected, GigabitEthernet0/1
L 10.10.20.1/32 is directly connected, GigabitEthernet0/1
The router has routes for both interfaces and can route traffic between hosts on the 10.10.10.0/24 and 10.10.20.0/24 networks.
4. Configure a static route to 10.10.30.0/24 with a next hop address of 10.10.10.2
R1(config)#ip route 10.10.30.0 255.255.255.0 10.10.10.2
5. What routes are in the routing table now?
R1(config)#do show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C 10.10.10.0/24 is directly connected, GigabitEthernet0/0
L 10.10.10.1/32 is directly connected, GigabitEthernet0/0
C 10.10.20.0/24 is directly connected, GigabitEthernet0/1
L 10.10.20.1/32 is directly connected, GigabitEthernet0/1
S 10.10.30.0/24 [1/0] via 10.10.10.2
The router has routes to its locally connected networks, and also to 10.10.30.0/24 which is available via 10.10.10.2
Additional Resources
What is a Router?: https://www.cisco.com/c/en/us/solutions/small-business/resource-center/networking/what-is-a-router.html
What is a Switch vs a Router?: https://www.cisco.com/c/en/us/solutions/small-business/resource-center/networking/network-switch-vs-router.html
What is a Router?: https://www.cloudflare.com/learning/network-layer/what-is-a-router/
Libby Teofilo
Text by Libby Teofilo, Technical Writer at www.flackbox.com
Libby’s passion for technology drives her to constantly learn and share her insights with others. When she’s not immersed in the world of tech, you’ll find her lost in a good book with a cup of coffee or out exploring nature on her next adventure—always curious, always inspired.