📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Cisco Router and Switch Configuration Step by Step | Connect Cisco Router & Switch to Internet

Cisco Config15:41

Transcription

In this video tutorial, I'm going to show you how to connect and configure a Cisco router and switch at your home or office internet using the router-on-a-stick method.

First, let me show you my network diagram and physical connectivity. This is my Cisco router that I am using in this video. This router has two Fast Ethernet ports. I will connect my Cisco router Fast Ethernet 0/0 port to my home ISP router. The internet working in my ISP router will also be configured. My router port will be DHCP enabled, so this port will get the IP address from the ISP router via DHCP.

This is my Cisco switch. I will connect my Cisco router port Fast Ethernet 0/1 to my Cisco switch on port Gigabit 0/48. In the Cisco switch, I will configure this port as a trunk port, and multiple VLANs will be passed by this port. I will also create three VLANs: VLAN 10, VLAN 20, and VLAN 30. On the router side, I will configure sub-interfaces for each VLAN.

This is our network diagram, and now let's go to the physical devices to do some physical connectivity. This is my home lab, and this is my Cisco 2800 series router and Cisco 2900 series switch that I'm going to use in this video. This is the back side of my device, and here you can see this is my router Fast Ethernet 0/0 interface. This blue network cable is coming from my home router and is connected to my Cisco router Fast Ethernet 0/0 port, as per our network diagram.

Now, I use another network cable and connect it to my Cisco router Fast Ethernet 0/1 port. At the second end of this network cable, I connect it to my Cisco switch Gigabit 0/48 port, and I will configure this port as a trunk port.

Now, to log in and configure the Cisco router, we need a console cable. I connect RJ45 to my Cisco router console port and USB to my laptop USB port.

Now, let's start configuration. First, I will configure our Cisco router. The first command I'm going to put here is enable. I type enable and press enter. To check the interface of my Cisco router, I type the command show IP interface brief. Here, you can see I have two interfaces in this router: Fast Ethernet 0/0 and Fast Ethernet 0/1. As I showed you earlier, I connect my router Fast Ethernet 0/0 port to my home ISP router, and it received the IP address automatically from my home ISP router via DHCP. Our Fast Ethernet 0/1 port is unassigned till now.

I want my Cisco router Fast Ethernet 0/0 port to always get an IP address via DHCP from my home internet router. For that, I go to privilege mode first by typing config T and enter. Now, here I type interface Fast Ethernet 0/0 and enter. I want this port to receive an IP from my ISP router via DHCP. For that, I type the command IP address DHCP and enter. Next, I type no shutdown and enter, and then exit.

So here you can see our Cisco router Fast Ethernet 0/0 port received an IP address via DHCP, and it received IP 192.168.1.1 from my home ISP router. Now, I will exit from privilege mode and let's try to ping the gateway of my home ISP router. For that, I type ping 192.168.1.1 and enter. Here you can see we can successfully ping the home internet router.

Now, we must add a static route to our Cisco router. For that, I go to privilege mode again by typing config T and enter. To add a static route in the Cisco router, we type the command IP route 0.0.0.0, which means any IP address, and 0.0.0.0 means any subnet, and route to my internet gateway, which is 192.168.1.1, and enter.

Now, let's check the routing table in our Cisco router by typing the command show IP route and enter. Oh, we need to add the do command first in privilege mode. Do show IP route and enter. Here you can see the static route that we just entered, and this is the directly connected cable from the ISP router on our Fast Ethernet 0/0 port.

Now, let's enable the Fast Ethernet 0/1 port first by using the no shut command because, by default, the port is disabled. Now it's time to configure the sub-interface on the Cisco router. To create a sub-interface for any VLAN, we type the command interface Fast Ethernet 0/1.10. This means this sub-interface is for my VLAN 10. Then we type the command encapsulation dot 1Q and this encapsulation is for VLAN 10, so I type 10.

Now, assign the IP address to this sub-interface. I type IP address 10.10.10.1 and subnet is 255.255.255.0, and then press enter. The next command is no shutdown and exit.

Now, I will do the same for VLAN 20 and VLAN 30 sub-interfaces. For that, I type interface Fast Ethernet 0/1.20. This means this sub-interface is for VLAN 20. Then we type the command encapsulation dot 1Q, which means this encapsulation is for VLAN 20, and enter.

Next, I assign the IP address to this sub-interface. For that, I type IP address 10.10.20.1 and the subnet is 255.255.255.0, and then press enter. The next command is no shutdown and exit.

Same for VLAN 30. I type command interface Fast Ethernet 0/1.30. Next, I type command encapsulation dot 1Q 30 and enter. Next, I assign the IP address to this sub-interface. For that, I type IP address 10.10.30.1 and the subnet is 255.255.255.0, and press enter. Then, no shutdown and exit.

Now, let's check our routing table again, but first, let's exit from privilege mode and then type show IP route and enter. Here you can see this is our VLAN 10 sub-interface route, this is our VLAN 20 sub-interface route, and this is our VLAN 30 sub-interface route.

Now, let's configure a DHCP server in the Cisco router for VLANs 10, 20, and 30. For that, we go to privilege mode first by typing config T and enter. Then we type the command IP DHCP pool, and here we give the pool name. I am creating this DHCP pool for VLAN 10, so I type 10 here.

Now we need to assign the network for VLAN 10. I type command network 10.10.10.0 and enter. Next, we need to define the default route. For that, I type command default router 10.10.10.1. This is our VLAN 10 gateway IP address, and press enter.

Next, we need to define the DNS server. For that, I type command DNS server 8.8.8.8 and enter, and exit from here. That's it! We successfully created a DHCP server for VLAN 10 in our Cisco router.

Now, I configure another DHCP server for VLAN 20. For that, I type IP DHCP pool 20 and enter. Then I type network 10.10.20.0 and enter. The default route is the gateway IP address for VLAN 20, which is 10.10.20.1, and enter.

Next, we give the DNS server 8.8.8.8 and enter, and exit from here. Next, we configure the DHCP server for VLAN 30. For that, I type IP DHCP pool 30 and enter. Then I type network 10.10.30.0 and enter. The default route is the gateway IP address for VLAN 30, which is 10.10.30.1, and enter.

Next, we give the DNS server 8.8.8.8 and enter, and exit from here. We successfully created the DHCP servers for our VLANs 10, 20, and 30.

Now it's time to configure the NAT. For that, first, we go to interface Fast Ethernet 0/0 for the IP NAT outside command because this interface is connected to my ISP router. I type IP NAT outside and enter, and exit from here.

Now we need to configure NAT inside on all sub-interfaces. For that, I type command interface Fast Ethernet 0/1.10. This is our sub-interface for VLAN 10, and here I type command IP NAT inside, enter, and exit.

Same for the other VLANs. I type interface Fast Ethernet 0/1.20, IP NAT inside, and exit. For our third VLAN, I type interface Fast Ethernet 0/1.30, then IP NAT inside, and exit.

Okay, our NATing is done, and now it's time to configure the access list. To configure the access list in the Cisco router, I type IP access-list standard, and here we need to assign a name to this access list. I give the name local and enter.

The next command is permit 10.10.10.0, which is my VLAN 10 network. After that, we need to add the wildcard mask, which is 0.0.0.255, and enter. I press the upper arrow and change this to 20, so this is my VLAN 20 network. We permit this also. Again, I press the upper arrow, and this time I permit my VLAN 30 network and exit.

Here we create the access list successfully and permit all three networks via this access list. Now it's time to configure the overload command. For that, I type IP NAT inside source list, and here you need to give your access list name. In my case, it's local, then interface Fast Ethernet 0/0 overload, and enter.

That's it! Now our Cisco router configuration is done, and now it's time to configure the Cisco switch. Let's move our console cable from the Cisco router to our Cisco switch console port and log in.

The first command we type here is enable and enter. To go to privilege mode, we type config T and enter. First, we configure the trunk port on our Cisco switch. For that, we type command interface Gigabit Ethernet 0/48. To make this port a trunk, we type switchport mode trunk and enter.

Then we type no shut and enter, then exit. Now this port is a trunk port. To verify that, we type command do show interface trunk and enter. Here you can see the status is trunking, and this is for my port Gig 0/48.

Now, I need to create VLANs 10, 20, and 30 in this switch. For that, we type command VLAN 10 and enter, then no shutdown and enter, and then exit. Next, we type VLAN 20 and enter, and no shutdown, and then exit.

For VLAN 30, I type VLAN 30 and enter, and no shutdown command, and then exit. We successfully created three VLANs in this Cisco switch.

Now, to check the VLAN status in the Cisco switch, we exit from privilege mode first by typing exit. Here, I type command show VLAN and enter. Here you can see three new VLANs are created: VLAN 10, 20, and 30.

Also, you notice here that currently, all interfaces belong to VLAN 1, the native VLAN. Now I assign these interfaces to my VLANs and create access ports on the Cisco switch. For that, we use the range command and type interface range Gig 0/1 till 16.

Next command I type is switchport mode access. Now these all ports are access ports. Next, I type switchport access VLAN 10. By this way, the first 16 ports now belong to VLAN 10 and exit.

The same thing I will do for the next 16 ports. For that, I type interface range Gig 0/17 till 32. Next command I type here is switchport mode access, switchport access VLAN 20. Now these ports also belong to VLAN 20 and exit.

Next command is interface range Gig 0/33 till 44. For these 12 ports, I give to VLAN 30, switchport mode access, switchport access VLAN 30, and exit.

To check the VLAN status again in the Cisco switch, we exit from here and then type command show VLAN and enter. Now here you can see VLAN 10 has 16 ports from Gig 0/1 to Gig 0/16, the next 16 ports belong to VLAN 20, and the next 12 ports belong to VLAN 30.

Now that's it! We successfully completed our configuration in the Cisco switch and Cisco router, and now it's time to check the service. This is my home Cisco network lab, and this is my Cisco router and switch that we configured.

I connect this blue laptop to the first 16 ports of this switch. These access ports belong to VLAN 10, and my other laptop is connected to the next 16 ports. These access ports belong to VLAN 20. Here you can see my trunk port is blinking continuously.

Now I go to my first laptop that is connected to VLAN 10, and on the Ethernet LAN card, we check the IP. Here I received 10.10.10.3 IP address. It means my laptop gets the IP address from the VLAN 10 DHCP server.

On my other laptop, the Ethernet LAN card received IP address 10.10.20.3, so my both laptops get the IP address from the Cisco router via DHCP.

Now let's open the web browser and check if the internet is working or not. Here you can see the internet is working, and the internet speed is like 100 megabits per second.

On my second laptop, let's check the internet first, and yes, it's working. Now check the speed, and here also we get like 90 megabits per second speed.

Now let's ping both PCs. I open the command prompt here and type ping 10.10.10.3 and enter. Here you can see I can ping from VLAN 20 to VLAN 10 PC successfully.

Thank you for watching, and please don't forget to like, share, and subscribe to my channel. Thank you!