Router on a Stick Inter-Vlan

Answered Question
Nov 28th, 2013
User Badges:
  • Silver, 250 points or more

Router(config)#interface f0/0

Router(config-if)#no shutdown


Router(config)#interface f1/0

Router(config-if)#no shutdown


Router(config)#interface f0/0.1

Router(config-subif)#encapsulation dot1q 15

Router(config-subif)#ip address 192.168.15.1 255.255.255.0

Router(config-subif)#interface f0/0.2

Router(config-subif)#encapsulation dot1q 20

Router(config-subif)#ip address 192.168.20.1 255.255.255.0


Switch1(config)#vlan 15

Switch1(config-vlan)#name SALES

Switch1(config-vlan)#vlan 20

Switch1(config-vlan)#name SUPPORT


Switch1(config)#interface fa0/1

Switch1(config)#switchport mode trunk

Switch1(config)#interface range fa1/1

Switch1(config-if)#no shutdown

Switch1(config-if)# switchport mode access

Switch1(config-if)# switchport access vlan 15

Switch1(config-if)#interface range fa2/1

Switch1(config-if)#no shutdown

Switch1(config-if)#switchport mode access

Switch1(config-if)# switchport access vlan 20


Switch2(config)#vlan 15

Switch2(config-vlan)#name SALES

Switch2(config-vlan)#vlan 20

Switch2(config-vlan)#name SUPPORT


Switch2(config)#interface fa0/1

Switch2(config)#switchport mode trunk

Switch2(config)#interface range fa1/1

Switch2(config-if)#no shutdown

Switch2(config-if)# switchport mode access

Switch2(config-if)# switchport access vlan 15

Switch2(config-if)#interface range fa2/1

Switch2(config-if)#no shutdown

Switch2(config-if)#switchport mode access

Switch2(config-if)# switchport access vlan 20


This is the Commands i used for 1 Router connected t o 2 Switches but it somehow i dont know it doesnt working :/.Im trying to add 2 Vlans + Default Vlan and connected it with class c /27 ip address Any help?


---

Posted by WebUser Charalampos Skeleton C'trattou from Cisco Support Community App

Correct Answer by Sandeep Choudhary about 3 years 8 months ago

Hi,

As per your topology.


see this and match ur config:



Router

---------------

interface FastEthernet0/0

no ip address

duplex auto

speed auto

!

interface FastEthernet0/0.1

encapsulation dot1Q 15

ip address 192.168.15.1 255.255.255.0

!

interface FastEthernet0/0.2

encapsulation dot1Q 20

ip address 192.168.20.1 255.255.255.0

-----------------------------------------------

Swicth 0

-------------

interface FastEthernet0/1

switchport mode trunk

!

interface FastEthernet0/2

switchport mode trunk

!

interface FastEthernet0/3

switchport access vlan 15

!

interface FastEthernet0/4

switchport access vlan 20

!

vlan 15

name SALES

!

vlan 20

name SUPPORT

-------------------------------------------------

Switch 2

---------

interface FastEthernet0/1

switchport mode trunk

!

interface FastEthernet0/2

switchport access vlan 15

!

interface FastEthernet0/3

switchport access vlan 20

!

vlan 15

name SALES

!

vlan 20

name SUPPORT

------------------------------------------------------

PC0

------

IP: 192.168.15.2

mask:255.255.255.0

GW:192.168.15.1



PC1

------

IP: 192.168.20.2

mask:255.255.255.0

GW:192.168.20.1



PC2

------

IP: 192.168.15.3

mask:255.255.255.0

GW:192.168.15.1



PC3

------

IP: 192.168.20.3

mask:255.255.255.0

GW:192.168.20.1



Hope it helps.

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Sandeep Choudhary Thu, 11/28/2013 - 04:49
User Badges:
  • Purple, 4500 points or more
  • Cisco Designated VIP,

    2017 Wireless


Where u r connecting the 2nd switch on router because you are creating sub interfaces on fa0/0.



What exactly not working ???
What u want yo acheive ??

Regards

Sent from Cisco Technical Support iPhone App

chandra_rc16 Thu, 11/28/2013 - 06:37
User Badges:

Is possible for you to the post the topology pic ?


or else


Can you make it clear with physical connection between the devices ?


Regards,

Chandu

Julio Carvajal Sun, 12/01/2013 - 00:09
User Badges:
  • Purple, 4500 points or more

Do the computers already have a valid IP address, DNS value and Default gateway??


If yes, what happens if you ping the Router sub-interface IP address for the respective vlan??


Can you ping between computers on the same VLAN???


Can you provide the output of show interface trunk of both switches?


Rate all of the helpful posts!!!

Regards,

Jcarvaja

Follow me on http://laguiadelnetworking.com

Correct Answer
Sandeep Choudhary Sun, 12/01/2013 - 00:29
User Badges:
  • Purple, 4500 points or more
  • Cisco Designated VIP,

    2017 Wireless

Hi,

As per your topology.


see this and match ur config:



Router

---------------

interface FastEthernet0/0

no ip address

duplex auto

speed auto

!

interface FastEthernet0/0.1

encapsulation dot1Q 15

ip address 192.168.15.1 255.255.255.0

!

interface FastEthernet0/0.2

encapsulation dot1Q 20

ip address 192.168.20.1 255.255.255.0

-----------------------------------------------

Swicth 0

-------------

interface FastEthernet0/1

switchport mode trunk

!

interface FastEthernet0/2

switchport mode trunk

!

interface FastEthernet0/3

switchport access vlan 15

!

interface FastEthernet0/4

switchport access vlan 20

!

vlan 15

name SALES

!

vlan 20

name SUPPORT

-------------------------------------------------

Switch 2

---------

interface FastEthernet0/1

switchport mode trunk

!

interface FastEthernet0/2

switchport access vlan 15

!

interface FastEthernet0/3

switchport access vlan 20

!

vlan 15

name SALES

!

vlan 20

name SUPPORT

------------------------------------------------------

PC0

------

IP: 192.168.15.2

mask:255.255.255.0

GW:192.168.15.1



PC1

------

IP: 192.168.20.2

mask:255.255.255.0

GW:192.168.20.1



PC2

------

IP: 192.168.15.3

mask:255.255.255.0

GW:192.168.15.1



PC3

------

IP: 192.168.20.3

mask:255.255.255.0

GW:192.168.20.1



Hope it helps.

Regards

sngashc1026 Sat, 11/30/2013 - 13:33
User Badges:

Are both the interfaces from Switch 1 going to the Router and to Switch 2 trunking? Your config shows only one port on Switch 1 statically configured as a trunk. Hope that helps

fb_webuser Sun, 12/01/2013 - 06:41
User Badges:
  • Silver, 250 points or more

The topology on the image is a Router on A stick which is based on 1 router and 2 switches. Basically the 1 switch is connected with the router and the other one is connected to the switch which leads to a inter vlan routing. The commands i posted lead to an error to ping between the pcs.i used a class c ip address which are basically writing at the post. im gonna try san deep answer and see afterwards


---

Posted by WebUser Charalampos Skeleton C'trattou from Cisco Support Community App

Sandeep Choudhary Wed, 12/04/2013 - 03:45
User Badges:
  • Purple, 4500 points or more
  • Cisco Designated VIP,

    2017 Wireless

HI ,


Did u connect the right interface to switch.?

swicth interface should be in trunk mode which is connect to router.



Regards

chandra_rc16 Wed, 12/04/2013 - 06:54
User Badges:

Can you post the "show cdp neighbors" from three of those devices ?


Regards,

Chandu

Actions

This Discussion