13 Replies Latest reply: Nov 7, 2008 11:31 PM by B Haines RSS

    Default gateway....?



      Thank you guys for being patient with me, Im still learning! Although tonight it feels like I havent learnecd a thing!



      What is a default gateway? How do you enter a default gateway? Why would you need to enter this gateway?



      Thanks in advance!






        • 1. Re: Default gateway....?


          Hi Raven



          PC are connected together on a Local Area Network normally Ethernet cables into a switch. Each PC has a IP address consisting of a network number and a host number. So if your PC are and ....



          then 192.168.1 is the network and .1 and .2 are the host numbers.



          If they want to go to the Internet you need a Gateway (Router). This Gateway will have an address such as



          So if you want to get to the Internet you send things to the default gateway



          Normally when you switch on your PC it issues a general request which says please give me my IP address and tell me the default gateway and other thing. All PC on the LAN sees the request but the Gateway say I will find a free IP number for you and tell you the default-gateway.



          If you need to explicity state the default gateway you code it on the PC using the Windows route command



          route ADD MASK METRIC 3

          destination^ ^mask gateway metric ^



          This says to get to any network go to Gateway which must be on your LAN.



          route print shows the value.



          Above is a very simple introduction because it is quite a big subject.



          Regards Conwyn






          • 2. Re: Default gateway....?





            As always thanks!! It kind of makes sense.....what is the purpose for a gateway? Just routing of IP address that are not permanent?



            I have the Cisco Press books for CCENT/CCNA ICND1/ICND2, and I also have the Exam Cram for CCENT. Is there any chapters or pages in there you can direct me to for reading?



            Is this part of the CCENT test? the reason I ask is Ive read the first Cisco book and dont remember coming across that?












            • 3. Re: Default gateway....?


              Hi Raven






              It is for any address that is not on your local area network.



              I am sorry I know nothing about the new Cisco exams it all changed a while ago.



              Regards Conwyn



              • 4. Re: Default gateway....?





                Im going to read up on it regardless (it has struck an interest). Do you know where in the books mentioned above I can find this info?



                Thanks again Conwyn!






                • 5. Re: Default gateway....?

                  Hi r.goforth

                  I think for me the best way I understood the concept was while applying it to my home network.

                  At home I assume you have a Cable/DSL modem/router - the internal IP address of this device would be the default gateway for your PC.


                  So, if your PC was trying to request www.cisco.com if would resolve the cisco.com domain to an IP address. Then, your computer would realize that this IP address is not on the local network and so the request would be forwarded out into the big world through your router (default gateway).










                  • 6. Re: Default gateway....?





                    Tha makes alot of sense thanks for clarifying the topic!






                    • 7. Re: Default gateway....?
                      B Haines


                      While researching the topic of a DEFAULT GATEWAY also research DEFAULT ROUTE (IE. DEFAULT NETWORK) and STATIC ROUTE! They all provide similar functionality but are indeed different.. Takes a while to grasp the differences so don't fret!


                      Here are some links that may be of interest for all three!!!


                      Default Route VS Static Route



                      Default Gateway VS Static Route (On a layer 2 switch) Just know that on a Cisco/HP and most other switches you have to use a static route to forward (Default Gateway will not work!)




                      Static Routes


                      Default Routes


                      Default Gateway



                      The Cisco Explanation:



                      Finally, How routers work from How Stuff Works website!!! Read this in it's entirety!!!



                      I hope this helps!

                      • 8. Re: Default gateway....?


                        Hi Billy and Raven



                        Just to clarify the default-gateway on a L2 switch. This always causes confusion.



                        A L2 switch has a management address called VLAN 1. If you add a new VLAN x then VLAN 1 disappears. So you can only have one what ever you call it. This VLAN 1 has an IP address so you can logon onto the switch to manage it. Now if you come from a distant network you need a route to get back. The L2 switch has a default-gateway which must point to a L3 device such as a router. So you can ping all the other devices with similar IP address but if the target of the ping is not within the local network then it sends the traffic to the named default-gateway. Note you have to fully type show default-gateway because it is a hidden command. Ordinary data entering the switch on one of the port simply passes through the switch. It is not routed.



                        I hope that is a fair explaination. Scott to clarify.



                        Regards Conwyn



                        • 9. Re: Default gateway....?


                          Hi Billy and Raven






                          Correction the command is : show ip default-gateway.



                          Regards Conwyn



                          • 10. Re: Default gateway....?
                            B Haines

                            Thanks Conwyn,

                            That is pretty much what the post I referenced is referring to with the exception that they claim it to be necessary to use a static route as opposed to the default-gateway command on an L2 switch with multiple VLANs.. Not applicable to an L3 model which will properly utilize the ip default-gateway command.. Follow the link and let me know what you think! I will read it more thoroughly and follow up!

                            • 11. Re: Default gateway....?

                              Hi Billy


                              Practical demonstration




                              It is a L2 2950 switch.



                              root#show version

                              Cisco Internetwork Operating System Software

                              IOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(22)EA6, RELEASE SOFTWARE (fc1)

                              Copyright (c) 1986-2005 by cisco Systems, Inc.



                              Look no routing




                              root#show ip route


                              % Invalid input detected at '^' marker.



                              Let us set a default-gateway




                              root#config t

                              Enter configuration commands, one per line. End with CNTL/Z.

                              root(config)#ip default-gateway




                              Let us try pinging something which is not on






                              Type escape sequence to abort.

                              Sending 5, 100-byte ICMP Echos to, timeout is 2 seconds:


                              Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/8 ms



                              So how did we get there?






                              Type escape sequence to abort.

                              Tracing the route to



                              1 0 msec 0 msec 0 msec (default-gateway address)

                              2 4 msec 0 msec * ( a distant router)



                              root#show ip default-gateway




                              What is our management address from show run




                              interface Vlan1

                              ip address

                              no ip route-cache


                              ip default-gateway



                              Regards Conwyn

                              • 12. Re: Default gateway....?
                                B Haines

                                Thanks Conwyn,

                                Do me a favor.. Take my last post and completely reverse it.. LoL


                                L2 Switch or L3 with No Routing enabled = ip default-gateway

                                L3 Switch with Routing enabled = ip route


                                I had to read my post twice to grasp the extent of dyslexia involved.. LoL


                                It's all in the link I posted before dyslexia kicked in.. Thanks for the help!

                                • 13. Re: Default gateway....?
                                  B Haines

                                  Seriously thanks.. I even managed to confuse myself on that one!!! It's bed time! LoL