13 Replies Latest reply: Nov 6, 2009 6:43 PM by kmog RSS

    Switch Default Gateway and Host Default Gateway...

    Mike.B

       

      Hi Guys,

       

       

      It's everyone's favorite game: Mike asks ridiculously simple questions!!!

       

       

      What's the purpose of specifying a default gateway on a switch? What's it used for? If my host (PC) already has a default gateway specified, isn't this overly-redundant?

       

       

      -M

       

       

        • 1. Re: Switch Default Gateway and Host Default Gateway...
          Conwyn

           

          Hi Mike

           

           

          ip default-gateway and show ip default-gateway confuse everybody.

           

           

          They only apply to a Level Two switch. One that does not route.

           

           

          There is a management interface called int vlan 1 to which you can telnet. This management interface has a mini-ip capability and is just clever enough to return message to other networks by sending to a router (the default gateway)

           

           

          So if you telnet from 1.2.3.4 and your switch has int vlan1;ip address 5.6.7.8 255.255.255.0 then he needs to be routed and he knows about a router on his network call 5.6.7.9 so he sends all his replies to 5.6.7.9.

           

           

          Once he becomes a Level Three switch (can router) he completely ignores ip default-gateway.

           

           

          Regards Conwyn

           

           

           

           

           

           

           

           

          • 2. Re: Switch Default Gateway and Host Default Gateway...
            Mike.B

             

            Thanks Conwyn. That makes more sense now.

             

             

            So if I had a layer-2 switch and for some reason didn't want to setup remote management for it (meaning that I prefered to only connect to the switch via the physical console port), I wouldn't have to specify a ip gateway for the switch right?

             

             

            Thanks,

             

             

            -M

             

             

            • 3. Re: Switch Default Gateway and Host Default Gateway...
              Conwyn

               

              Hi Mike

               

               

              Nor even type

               

               

              int vlan1

               

               

              ip address 1.2.3.4 255.255.255.0

               

               

              no shut

               

               

              Regards Conwyn

               

               

              • 4. Re: Switch Default Gateway and Host Default Gateway...
                goddur

                Is layer 3 switch required knowledge for ICND1?

                • 5. Re: Switch Default Gateway and Host Default Gateway...
                  Mathew Newton

                  Even if you didn't want to telnet to it I suppose you might still want to set up the default-gateway (and vlan1 config) if you required the ability to ping the switch and/or update the IOS via TFTP.

                   

                  Mathew

                  • 6. Re: Switch Default Gateway and Host Default Gateway...
                    amine00

                    Hi Mike,

                     

                    Just a comment on what you consider being ridiculously simple question: Your questions and their answers helped me a lot for last days revision before sitting for the exam. You've generated an important amount of information in this board.

                     

                    Goddur, layer 3 switches are not in the CCNA scope.

                    • 7. Re: Switch Default Gateway and Host Default Gateway...
                      Mike.B

                      Thanks Amine!.

                       

                      It's funny, I'm reminded of a saying my english teacher used to tell my fellow students and I: "Never be afraid to ask questions.  Chances are, there are at least a couple other people who can benefit from the answer."

                       

                      -M

                      • 8. Re: Switch Default Gateway and Host Default Gateway...
                        Conwyn

                        Hi Mike

                         

                        I think your teacher meant people in that classroom he may not have envisaged the global classroom that is the CLN.

                         

                        I am looking forward to your CCXP and CCIE questions.

                         

                        Regards Conwyn

                        • 9. Re: Switch Default Gateway and Host Default Gateway...
                          kmog

                          Hi guys (Conwyn)

                           

                          I would like to revist this thread and hopefully get somethings clarified....

                           

                          Hi Mike

                           

                           

                          ip default-gateway and show ip default-gateway confuse everybody.

                           

                           

                          They only apply to a Level Two switch. One that does not route.

                           

                           

                          There is a management interface called int vlan 1 to which you can telnet. This management interface has a mini-ip capability and is just clever enough to return message to other networks by sending to a router (the default gateway)

                           

                           

                          So if you telnet from 1.2.3.4 and your switch has int vlan1;ip address 5.6.7.8 255.255.255.0 then he needs to be routed and he knows about a router on his network call 5.6.7.9 so he sends all his replies to 5.6.7.9.

                           

                           

                          Once he becomes a Level Three switch (can router) he completely ignores ip default-gateway.

                           

                           

                           

                          1.) How exactly does the switch mini-ip capability work? can the switch understand a different IP when it sees one and sends it to DGW, or does it discover this by ARP with ARP-proxy set on the upstream router?Basically what I m failing to see here is when ARP isused and when 'mini-ip' kicks in..

                           

                          2.) also if this is neccesary for management,how about an internet destined packet, routed from host through the switch then to the router and on and on to the internet? would the DGW be needed for that too?

                           

                          Thanks guys

                           

                          K

                          • 10. Re: Switch Default Gateway and Host Default Gateway...
                            Conwyn

                            Hi K

                             

                             

                            Arp is used to find the MAC address for an IP

                             

                            So If I want to send an IP packet outside my subnet I use the default gateway. So I arp the default-gateway ip address and get back the mac address (which will be the router.

                             

                            A packet from a PC will ask the PC for the default gateway which will be the router. If the PC does not have a default-gateway he may send the packet. The switch provides L2 connection and the proxy-arp router responds with it mac address.

                             

                            Do not confuse normal function of the L2 switch with the management facility on the switch.

                             

                             

                            Regards Conwyn

                            • 11. Re: Switch Default Gateway and Host Default Gateway...
                              kmog

                              Hi Conwyn

                               

                              I hear you Conwyn, now lets walk throught it one more time....If i PC has a DGW on its RT and assuming it has sent packets before, it will already have the mac address of the router(via ARP and ARP proxy), and so there is no need for the default gateway on the switch right? So exactly how does the default-gateway command come in play? Doesnt the management follow the same process? How does the management facility on the switch differ from normal operation of a switch?

                               

                              Thanks

                               

                              K

                              • 12. Re: Switch Default Gateway and Host Default Gateway...
                                Conwyn

                                Hi K

                                 

                                Let us pretend you can only use the CONSOLE port on the switch. How would you access the manage the switch from 100 miles away.

                                 

                                You take a real router and a PC. You connect the serial port of the PC to the CONSOLE port of the switch. You install software on the PC to emulate a 9600 bit serial interface. You put remote access software on the PC.  You connect the PC to the router and the router to a router at your remote location. You connect your PC to the remote location. You logon to the remote PC then using IP you take control of the PC connected to the switch. Then you invoke the serial 9600 software and type in commands like config t; int switchport. 

                                 

                                The remote PC is eqivalent to telneting to the management interface.

                                 

                                Regards Conwyn

                                • 13. Re: Switch Default Gateway and Host Default Gateway...
                                  kmog

                                  Thanks Conwyn,

                                   

                                  I think I get it now...

                                   

                                  BTW do you know if its possible to specify the virtual int(SC0) in smaller switches like you can on the 6500s?

                                   

                                  Thanks again