Skip navigation
Cisco Learning Home > Certifications > Routing & Switching (CCNA) > Discussions

_Communities

This Question is Answered
6134 Views 14 Replies Latest reply: Feb 5, 2010 10:54 AM by Leo Pastor RSS

Currently Being Moderated

Vlan/Routing-on-a-stick

Feb 10, 2009 6:41 PM

ciscoskeemz 462 posts since
Jul 10, 2008

 

Hey everyone.

 

 

I have a quick question on vlans. If implementing vlans using router-on-a-stick configuration, i understand that you create sub-interfaces on the router and set the encapsulation dot1q. I have configured it correctly, and everything is working.

 

 

On all of the switches(2950s), vlan 1 is configured with an IP address on each. (S1 vlan1 192.168.1.10, S2 vlan1 192.168.1.11, S3 vlan 1 192.168.1.12). I have also created Vlan 100 and vlan 200

 

 

My question is, am I correct in saying that it is only when using layer 3 switches that you assign IP addresses to the additional VLANS?

 

 

For instance, on my main 2950 switch, thats has vtp mode of server, I can assign an ip address to vlan 1, then i can create vlan 100, and my switch will allow to assign an ip address to that vlan(100), but why would that ever be needed?

 

 

Sorry if this is confusing.

 

 

Mike

 

 

  • Currently Being Moderated
    1. Feb 10, 2009 9:53 PM (in response to ciscoskeemz)
    Re: Vlan/Routing-on-a-stick

    For a layer 2 switch such as a 2950 or 2960 you only need an IP address in one VLAN, usually your management VLAN. You don't need an IP address for each VLAN that traverses that switch. The purpose of this IP address is generally for remote management and logging in to the device.

  • Scott Morris - CCDE/4xCCIE/2xJNCIE 8,396 posts since
    Oct 7, 2008
    Currently Being Moderated
    2. Feb 10, 2009 10:29 PM (in response to ciscoskeemz)
    Re: Vlan/Routing-on-a-stick

    Not a confusing question at all... Confusing topic perhaps, but good question. Let's see what we can do about it!

     

    SVI's perform two basic functions:

     

    1. They give a switch a "presence" within a VLAN. This means you can ping, telnet to, or otherwise manage the switch via that VLAN (without routing)

     

    2. They give a switch the ability to route between VLANs provided that hosts use your switch (or router on a stick) address as the default gateway.

     

    #2 is the part that you need to have an L3 switch capability for. Otherwise you are merely giving yourself the chance to manage your switch via multiple subnets or IP addresses!

     

    Presence is an L2 thing. Routing is an L3 thing.

     

    HTH,

     

    Scott

    smorris@internetworkexpert.com

     

  • Chris 811 posts since
    Jul 25, 2008
    Currently Being Moderated
    4. Feb 11, 2009 4:54 AM (in response to ciscoskeemz)
    Re: Vlan/Routing-on-a-stick

     

    Hi Cisco,

     

     

    You only need a default gateway on an L2 switch for management purposes. The default gateway provides a way for the switch to "know" where to route packets when sending them back to your terminal located in an remote network/subnet.

     

     

  • Scott Morris - CCDE/4xCCIE/2xJNCIE 8,396 posts since
    Oct 7, 2008
    Currently Being Moderated
    5. Feb 11, 2009 5:55 AM (in response to ciscoskeemz)
    Re: Vlan/Routing-on-a-stick

     

    As far as I'm aware, RoaS isn't a typically used acronym. (I had to stare at it for a while, although that may be lack of caffeine this morning and late night working combined!)

     

     

    Anyway... For any device to reach "off subnet" then it will need to have a default gateway configured (if in L2/host mode) or a default route configured (if in L3/router mode).

     

     

    Otherwise it won't know where to go.

     

     

    Scott

     

     

     

     

     

  • Armen 247 posts since
    Jul 7, 2008
    Currently Being Moderated
    7. Feb 11, 2009 7:48 AM (in response to ciscoskeemz)
    Re: Vlan/Routing-on-a-stick

     

    Hi cisco...

     

     

    Follow link below to a diccussion, it might help you with default-gateway in switches.

     

     

    https://learningnetwork.cisco.com/thread/3970?tstart=45

     

     

    Armen

     

     

  • Chris 811 posts since
    Jul 25, 2008
    Currently Being Moderated
    8. Feb 11, 2009 8:05 AM (in response to ciscoskeemz)
    Re: Vlan/Routing-on-a-stick

     

    Hello Cisco,

     

     

    Actually, you would not be required to have ip default-gateway set on any of the switches. Switches operate at L2 with MAC/physical addresses; and therefore don't care about L3 IP/logical addresses. L2 switches, unless being a managed switch, will not contain a routing table like your Hosts/PC's will. Your hosts need a routing table because they have IP addresses and if they want to communicate with Hosts on "other" networks/subnets then they'll have to have an default gateway configured. Similary, if your L2 switch is an "managed" switch, which means it must have an logical IP address assigned to it in order for other hosts to communicate with it: Then it too at this point requires an default gateway in order to "route" IP packets back the "Default Gateway" and thus to the other networks/subnets.

     

     

    HTH

     

     

  • Chris 811 posts since
    Jul 25, 2008
    Currently Being Moderated
    9. Feb 11, 2009 8:11 AM (in response to ciscoskeemz)
    Re: Vlan/Routing-on-a-stick

     

    Oh, and no, it wouldn't have hurt to have configured S2 and S3 with default gateways, if they too are going to be "remotely" managed from another subnet. Just make sure in this case all three switches would have the same IP address for the default gateway.

     

     

     

     

     

  • Scott Morris - CCDE/4xCCIE/2xJNCIE 8,396 posts since
    Oct 7, 2008
    Currently Being Moderated
    11. Feb 11, 2009 9:13 AM (in response to ciscoskeemz)
    Re: Vlan/Routing-on-a-stick

     

    It's good to make me think every once and a while.

     

     

    The gateways will be helpful on your switches if you wish to manage them from some non-directly-connected network.

     

     

    Cheers,

     

     

    Scott

     

     

     

     

     

  • Chris 811 posts since
    Jul 25, 2008
    Currently Being Moderated
    Re: Vlan/Routing-on-a-stick

     

    Hey Scott,

     

     

    When you posted this the other day I read this in an cursory fashion and didn't process your intent. Reading it again, your point is well-taken: Would not necessarily need default-gateway set if remote subnet your managing switch from is an directly-connected interface on the "shared" router.

     

     

    Thanks

     

     

  • Scott Morris - CCDE/4xCCIE/2xJNCIE 8,396 posts since
    Oct 7, 2008
    Currently Being Moderated
    13. Feb 15, 2009 10:07 PM (in response to Chris)
    Re: Vlan/Routing-on-a-stick

     

    No worries. Sometimes I have to re-read my own ramblings a couple days later to make sure I still make sense.

     

     

     

     

     

     

     

    Scott

     

     

     

     

     

  • Leo Pastor 124 posts since
    Jun 27, 2008
    Currently Being Moderated
    14. Feb 5, 2010 10:54 AM (in response to ciscoskeemz)
    Re: Vlan/Routing-on-a-stick

    Don´t forget that 2950 is a "Layer 2 switch", and it operates much like any other node regarding Layer 3 (such as a PC) on the network. This discussion becomes complex with multilayer switches...

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)