Cisco – How to configure router on stick with cisco router

ciscorouterswitch

I have this scenario in my home lab

enter image description here

My cisco 2600 router has only 1 physical interface so i have divided into 3 sub interfaces

  1. E0/0.1 for vlan 10
  2. E0/0.2 FOR vlan 20
  3. E0/0.3 for vlan 1 which is in same subnet as my mian netgear router which is dhcp server
  4. The cisco switch is Layer 2 switch

  1. First i want to know that is this setup possible or need router two 2 interfaces
  2. i have setup default gateway to be 192.168.0.1 but i can't ping to it from router.

Internet on Laptop is working fine via ethernet cable and its getting valid ip from netgear router

Best Answer

  1. Yes, it is possible.

  2. You are doing something wrong, most likely tagging frames on the router but the trunk has VLAN 1 as native.

To confirm what your trunking settings are use:

show interfaces trunk

I like to keep the subinterface IDs matching the VLAN number although it is not required. Use a configuration like:

! Switch
! Port to Laptop
interface Fax/x
switchport mode access
switchport access vlan 1
spanning-tree portfast
description Port to PC
! Port to Netgear
interface Fax/x
switchport mode access
switchport access vlan 1
spanning-tree portfast
description Port to Netgear
! Port to Cisco router
interface Fax/x
switchport trunk encapsulation dot1q
switchport mode trunk
spanning-tree portfast trunk
description port to Cisco router

For the router:

! Router
! Port to switch
interface E0/0.1
encapsulation dot1q 1 native
ip add 192.168.0.70 255.255.255.0
description VLAN1 to Netgear
interface E0/0.10
encapsulation dot1q 10
ip add 192.168.10.70 255.255.255.0
description VLAN10
interface E0/0.20
encapsulation dot1q 20
ip add 192.168.20.70 255.255.255.0
description VLAN20
ip routing
ip route 0.0.0.0 0.0.0.0 192.168.0.1

Obviously replace IP with your desired IP in the subnet.

Related Topic