Hello friends, in this video I am going to show you how to connect Cisco router and switch to your office or home internet connection by using router on a stick method. This is my second video on this topic. I got very good feedback on my first video and that motivated me to make another video on same topic but to another way. My name is Abdul Basit and the process I am going to use in this video is called router on a stick method. Here you can see the network diagram and you notice that there is only one link between router and switch and it look like we put Cisco router on top of the stick.
That's why it's called router on a stick method. The router I am going to use in this video is Cisco 2800 series router and the switch is 2960 G-switch. The link between Cisco router and switch is 802.1q trunk link and multiple VLAN will travel on this link. Normally we use this method when we don't have layer 3 switch and we use our cisco router for intra vlan connectivity or intra vlan routing. In this process I will create sub interface on FASI thread 0 slash 1 port of my router.
How many sub interface need to be configured it depend on how many vlan we have. In this video I have 3 vlan, vlan 10, 20 and 30. So I will create 3 sub interface. Also here you can see the IP scheme that I am going to use in this video.
First I am going to configure fasteth0 slash 0 port of my router that will connect to my home ISP router. I will not configure any static IP on this port. I just want as a DHCP and fasteth0 slash 0 port receive IP address from my home router DHCP server. So let's start it. Okay friend this is my home lab.
Here you can see. This is my Cisco 2800 series router and Cisco 2960 switch that I'm going to use in this video. This is the back interface of my device. Here you can see this is my router fastethin0 slash 0 port.
This blue cable is coming from my home ISP router and it connect to fastethin0 slash 0 port. I will use a cat6 cable and it will connect to my fastethin0 slash 1 port. The one end is connected to my FastEthernet 0.0.1 port.
The second end of this CAT6 cable, I'm going to connect my Cisco router Gig 0.0.48 port and I will make it as a trunk. Here you can see I connect this gray cable to my Gig 0.0.48 port and I will make it as a trunk port. VLAN 10, 20 and 30 will travel on this trunk port. I use this console cable to log in to Cisco router.
The RG45 end is going to connect Cisco router console port and the USB end is going to connect my laptop USB port. So let's start our configuration. First I am going to configure Cisco router in this video. I will do this in very easy and small steps.
Now I am going to open Putty. Click on Putty and click on Open. That's it. Now press couple of Enter and here you can see.
I log into my Cisco router. The first command I'm going to put here is enable. I put enable command and press enter. To check the interface of my Cisco router, I type command show ip interface brief and press enter.
Here you can see I have two interfaces in this router FASI 300 0 and FASI 300 1 As I show you before I connect my FOSS Ethernet 0 slash 0 port to my home ISP router LAN port and it received the IP address automatically from my home ISP router via his DHCP. Here you can see and the state and the protocol are up and my FOSS Ethernet 0 slash 1 is unassigned till now because we did not connect anything there. Now I press couple of enter. I will not give any static IP to my FAST Ethernet 0 slash 0 port. What I want, this port should get IP from my ISP router via DHCP.
For that, I will go to privilege mode first. So I type config t and enter. Now I need to go to FAST Ethernet 0 slash 0 interface.
I type the command interface FAST Ethernet 0 slash 0 and enter. I want this port to receive IP from the DHCP server of my home router. For that I type command IP address DHCP it take couple of second I will wait and next one I put no shut down and exit so here you can see my fast ethernet 0 slash 0 port receive the IP address via DHCP and he receive IP 192.168.1.11 from my home router now i will take exit from privilege mode now i try to ping the gateway of my home router i type ping 192.168.1.1 and enter and here you can see i successfully ping my home router after receiving ip via dhcp till now i successfully connect my cisco 2800 series router to internet now in next step I need to add static route for that I will go to privilege mode first I type command config t and enter to add static route I will type command ip route and its mean any ip address and the any subnet and it will route or statically route to my gateway 192 .168.1.1 this is my home router or office router whatever you can say and enter.
Now if I check my routing table with command show ip route show ip route and enter. Ok I am in privilege mode so I need to add do command instead of show command show ip route. Here you can see the to root. This is my static route that I just enter and here you can see it will via 192.168.1.1 and this is directly connected my fast ethernet 0 slash 0 port.
Here is it and it received the ip 192.168.1.11 and it is directly connected to my home router. Now it's time to configure sub interface on my fastethernet0 slash 1 port but first i need to enable fastethernet0 slash 1 port with no shut command because by default port is disabled so i type interface fast ethernet 0 slash 1 and i will type no shut down and exit now i enable my fastethernet0 slash 1 port with no shut command and the port is enabled here you can see the state is changed now it's time to configure our sub interfaces now i'm going to create sub interface for vlan 10 i will type interface fast ethernet 0 1 dot 10 to create sub interface we need to type the vlan number after the interface with dot so i type here dot 10 It's mean this is the sub interface here you can see sub interface for VLAN 10. So as per our network diagram you know the connection between the switch gig 0 slash 48 port and the router fast ethernet 0 slash 1 port is a trunk 82.1q. So I put command encapsulation dot 1q and this encapsulation for VLAN 10. Now I will add command in calculation dot 1 cube space 10 next one I need to give the IP address to this sub interface I will type IP address 10 dot 10 dot 10 dot 1 and subnet is 255 dot 255 dot 255 dot 0 and I press ENTER you can see this IP scheme in my network diagram here is it and next command is no shutdown and exit. I successfully create the sub interface for VLAN 10. Now I will do same for VLAN 20 and 30. I type command interface fasteth0 slash 1 dot 20 mean this sub interface for VLAN 20. I need to enable encapsulation. I will type encapsulation dot 1q.
and 20 so this encapsulation for VLAN 20 next I need to give IP address to this sub interface I will type command IP address 10 10.10.20.1 10.10.20.1 is the gateway for sub interface for VLAN 20 and the subnet is the next command is no shutdown and exit same for VLAN 30 I type command interface fast ethernet 0 slash 1 dot you 30 and enter. Next I need to do encapsulation. Sorry I typed wrong command. I type encapsulation.1q 30. This encapsulation for VLAN 30. Now I will assign IP address to VLAN 30 sub interface.
I type command IP address 10.10.30.1. this is the subnet press enter and no shutdown and exit that's it for fast ethernet 0 slash one port till now now i check my routing table again with command show ip route i will exit from privilege first and i type the command show ip route and enter Now this time you can see we have too many IP route before we have only two IP route one is a static IP route and one is fast thread 0 slash 0 port. But now this time we have sub interfaces also here you can see 10.10.10.1 is directly connected to fast thread 0 slash 1.10 mean this is VLAN 10 sub interface this is for VLAN 20 sub interface.
and this is for VLAN 30 sub-interface and their IP addresses. Here you can see in IP route. Now I will configure DHCP server on router for VLAN 10, 20 and 30. For that I need to go to privilege mode first. I will type command config t and enter. To configure DHCP pool for VLANs I type the command ip dhcp pool Now here I need to give the pool name or pool number anything for my reference.
What I will do, I will give the VLAN number for each pool. For VLAN 10 pool, I give the name 10 and enter. Now I need to assign the network.
For VLAN 10 pool, I type command network slash 24. So full subnet. Next I need to. assign the default route for this dhcp pool i will give the default route is 10.10.10.1 this is the sub interface vlan 10 ip we have to give here as a default route and for dns server i give google dns server 8.8.8.8 enter and exit now i will configure two more dhcp server for vlan 20 and 30 i type command IP DHCP Pool for VLAN 20 pool I give the name 20. The network for VLAN 20 I type command 20.0 slash 24. Enter and the default route is the IP address of sub interface for VLAN 20 that is 10.10.20.1 Next we give DNS server that is 8.8.8.8 and that's it exit. Now DHCP pool for VLAN 20 is done. Now we need to create DHCP pool for VLAN 30. I type command IP DHCP pool VLAN.
Sorry we have to give the VLAN number for our reference 30. Next command we need to give the network. Network is 10. and the default route is same the sub interface IP for VLAN 30 that is 10.10.30.1 and DNS server that is 8.8.8.8 enter exit we successfully configure the DHCP pool for VLAN 10 20 and 30 now it's time to configure the netting Now we need to enable IP NET outside and inside First I will go to interface fastethernet0 slash 0 for ipnet outside command because this interface is connected to my ISP router so I will give command ip net outside here it will take couple of second I press enter it will take a couple of second and exit no it take time yes exit Now I configure NAT inside on my old sub interface that I configured before. For that I type command interface fastethernet 0 slash 1 dot 10. This is my sub interface for VLAN 10 and I type command ip nat inside. Enter and exit.
Same on other sub interface I type command interface fastethernet 0 slash 1 dot 20 and ip net inside enter exit on my third interface interface for thread 0 slash 1 dot 30 and ip net inside exit okay our netting is done now it's time to configure the access list to configure access list i type IP access list standard now here I need to give the name of the access list that I will configure and I will permit or deny some network name I give here is local and the name is case sensitive I type first L is capital here you can see so we have to keep remember this thing I permit the network via this access list. is network that is for my VLAN 10 network and I need to add the white card next thing I need to permit is I press the upper arrow and the last command is shown and I change the.20 only instead of 10 so this is for my VLAN 20 I permit VLAN 20 subnet and this is.30 for VLAN 30 and exit. So I create access list successfully and I permit my three network 20.0 and 30.0 via this access list. Now it's time to give the overload command on FOSS Ethernet 0.0 port. For that I will type command ip net inside source list.
Now here we have to give our access list name whatever name you give any number or name you have to type here in my case I give the name local and l capital because this is case sensitive local interface fast ethernet 0 slash 0 overload that's it now my router configuration is done and it's time to configure switch on switch I will configure the trunk port between my router and switch I will use gig 0 slash 48 port as a trunk and I have to configure the VLAN inside the switch VLAN 10 20 and 30 also I will assign some interface to each VLAN so now it's time to disconnect our console cable from Cisco router and I will connect this cable to my switch console port now I remove this console cable from console port of my router because the router configuration is done and I will connect this console cable to my switch console port that is on the back side of this switch here you can see the console port and I will connect this console cable here and now I can login this switch. Okay now I connect console cable to my switch console port and I press couple of enter the first command I type here is enable and enter. To go to privilege mode, I type command config t. As per network diagram, you can see the gig 0 slash 48 port is connect to my Cisco router for c300 slash 1 port and it is trunk port. So, I will go to interface gig 0 slash 48 and I will make it as a trunk.
The next command is switchport mode trunk and no shut exit Now I convert this port from access to trunk. To check the trunk port I will type command show interface trunk. I need to type do before the show command and enter.
So here you can see the status is trunking and this is for my gig 0 slash 48 port. Trunk port is configured and now I will create VLAN 10, 20 and 30. In my switch for that I type command VLAN 10 enter next I will type command no shutdown and exit same thing for VLAN 20 enter and no shutdown and exit and for VLAN 30 no shutdown command and exit. So the 3VLAN is created.
Now I need to assign the IP address to each VLAN for that I will go interface VLAN 10 First I will assign the IP address to my VLAN 10 Enter I will give IP address You know the network for VLAN 10 is So.1 IP I give to sub interface for VLAN 10 in router And.2 IP I will give to my switch VLAN and the subnet is enter and exit now same thing I will go to interface VLAN 20 and I will assign IP address to VLAN 20 that is 10.10.20.2 from.20 network and subnet is and exit same thing for interface VLAN 30 and I give IP address 10.10.30.2 and subnet is and enter exit that's it so till now in the switch we create trunk port on our gig 0 slash 48 port Also, we create three VLANs, VLAN 10, 20 and 30. Also, I assign IP address to each VLAN. To check the VLAN status, I exit from privilege mode, type command exit and I type command show VLAN, enter. So, here you can see three VLANs is created, VLAN 10, 20 and 30. But you notice all interface. or belong to VLAN 1 the native VLAN. So now it's time to assign some interface to each VLAN.
For that I will go to privilege mode first config T. As per my network diagram I give first 16 port to VLAN 10 and next 16 to VLAN 20 and last 12 to VLAN 30. So I type command interface range gig 0 slash 1 and till 16 first 16 port next one I will type is switch port mode access I will create this port as access next is switch port access VLAN 10 so first 16 port now belong to VLAN 10 and exit now same thing I need to do for other interface interface range 0 slash so I give first 16 port to VLAN 10 so I start from 17 till 32 the next 16 port interface range gig 0 slash 17 to 32 next command I will type here switch port mode access switch port access VLAN 20 so this 16 port now belong to VLAN 20 you and exit. The next command is interface range gig 0.33 till 44. So this 12 port I give to VLAN 30. Switchport mode access.
Switchport access VLAN 30. Exit. To check the VLAN status, I will exit from playability mode and I type command show VLAN and enter now here you can see VLAN 10 It have a 16 interface from gig 0 slash 1 to gig 0 slash 16. For VLAN 20 also I give next 16 interface till gig 0 slash 32. And for VLAN 30 I give 12 interface till gig 0 slash 48. I want to add one more command here. For that I will go to config team.
We give spanning tree port first command to all ports. to bypass spanning tree process and assign ip immediately to the end device for that i type command interface range gig 0 1 till 48 and the command is spanning tree port fast and enter what will happen when we connect our end device to any port to our switch it will take 30 seconds to receive the ip from the DHCP pool. Why? Because it will go by sparing tree process.
First 15 second go for listening and then next 15 second for learning. So to bypass this 30 second time duration we use this command sparing tree port first and exit now. That's it we complete our configuration in Cisco switch. Now it's time to check the service.
I need to connect my laptop to switch first 16 port. that belong to VLAN 10 and I should receive IP from 10.10.10 network via DHCP server of VLAN 10. Same thing I will connect one more laptop to next 16 port and I should get the IP from 20.0 network that belong to VLAN 20 and I will try to browse the internet from that PC. Also, I will try to ping both laptop to each other to check the intra VLAN routing.
Okay friend, this is my home network here you can see this is our Cisco 2800 series router and Cisco 2960 series switch that we configured just now and it's time to test. I use this two laptop. The guru laptop I am going to connect this guru cable in first 16 port and this belong to VLAN 10. This is the RG45 second end of this cable.
I am going to connect with my Cisco Acer laptop. LAN cable here and this gray cable or white cable that I am going to connect in VLAN 20. Here is it. The blue cable I connect in VLAN 10 and gray cable I connect in VLAN 20. And I will check.
Here you can see the trunk code is blinking continuously. Now I go to my Acer laptop that connect to my VLAN 10. Here is it. And we check the IP what we will get. go to the network ethernet change the setting and we see what ip he will get and here is it he got 10.10.10.3 which means he got the ip from vlan 10 and this is my second laptop now check his lan card you go to the network ethernet and here you can see the details and he get the ip 10.10.20.3 so my both laptop will get the ip from this laptop so my this laptop got the ip from vlan 10 and this laptop got the ip from vlan 20 now i try to browse the internet and see the internet is working or not i open the browser in vlan 10 laptop and I open bbc.com yes so internet is working fine if I check the speed speedtest.net my router have a fe port so it cannot go more than 100 even if I have a more than 100 connection Ok, now this PC is working, VLAN 10 is working fine, Internet is browsing, everything is ok.
Now I will go to my second laptop that connect on my VLAN 20. I open browser here and first I check the browsing, it is working or not. I go to bbc.com, yes and if I check the speed, it says bbc.net. and it also getting a little down and you can see the speed yes it go more than 90 mb okay now my both laptop is working fine internet is working now i will check the intra video connectivity talking to each other for that first i need to know the ip for each laptop this laptop have 10.10.3 and this laptop ip is 10 dot 10 dot 20 dot thread. So I open the command prompt here and I type the command ping 10 dot 10 dot this laptop update that is 10 dot thread.
10.3 and enter. So I can ping from VLAN 20 to VLAN 10. Now I try to check I will ping from VLAN 10 to VLAN 20 or not for intra VLAN connectivity. I will type command ping 10.10.20.3.
This is the IP and here you can see the IP 20.3. 20.3 and enter. Yes. So our intra VLAN connectivity also working. So thank you for watching my video and please like and subscribe my channel and put your comments for more video.