14 Replies Latest reply: May 30, 2011 11:35 AM by Diwakar Sharma -CCNA/CCNP/JNCIA-ER RSS

    Setting Default Route

    poison3000

      Hi everybody ..

       

      I'm confused with two commands are used to set a default route ... the two commands are :

       

      • R1 ( config )# ip route 0.0.0.0 0.0.0.0 se 0/0/1
      • R1 ( config )# ip route default-network 10.0.0.0

       

      What the expected behaviour of both commands and when to use them ?

       

      Thanks in advance !

        • 1. Re: Setting Default Route
          Chad Spears CCNP CCDA CCNAS

          Poison-

           

          The two commands are:

           

          ip route 0.0.0.0 0.0.0.0 (exit interface/next hop ip address)

          ip default-network (network number)

           

          The major difference between these two are, when you configure a static default route it is only applied to the router on which you configure it on.

          On the other hand, ip default-network will send the default route out it's routing protocol.

           

          To make a default static route (ip route 0.0.0.0 0.0.0.0) propagate throughout the environment, you will need to redistribute the static route into your IGP (Interior Gateway Routing Protocol).

           

          HTH,

          CS

          • 2. Re: Setting Default Route
            tnewshott

            Great explanation Chad!  We really need a "like" button here. 

            • 3. Re: Setting Default Route
              Chad Spears CCNP CCDA CCNAS

              Thans Travis

              • 4. Re: Setting Default Route
                poison3000

                Thank u Chad ... outstanding answer and straight forward , I will try to check this using Packet Tracer as soon as possible ..

                 

                If u dont mind ... could u plz shed some light on "Gateway of Last  resort is 192.168.2.1 to network 0.0.0.0 " and how it would vary ? bcoz I  know it is realted to the defult routing but I cant get the idea ..

                • 5. Re: Setting Default Route
                  Chad Spears CCNP CCDA CCNAS

                  Sure thing.  The statement "Gateway of last resort is 192.168.2.1 to network 0.0.0.0"

                  would be found on a neighboring router that recieves the canidate default route.

                   

                  All the statement is saying is of any traffic for which i do not have a route for... send it to 192.168.2.1.

                   

                  I will work on labbing this up for you to help  better explain.

                   

                  HTH,

                  CS

                  • 6. Re: Setting Default Route
                    WadeGerencser

                    Chad,

                     

                    I posted my reply just before you and I came on finally too see that you indeed have a great response. I have a question though..sorry to interrupt Poison, but if when you refer the major difference between the two configurations is simply a matter of how the default route / static route is learned dynamically or manually they still, at the end of the day, perform the same function...I mean it like this..figuratively...and please bear with me...its concept here on a simple misunderstanding that has been killing me lately!!

                     

                    Could you could still configure 4 routers, one with IP route 0.0.0.0 0.0.0.0 s0/0/1 and then the second router by the default-network x.x.x.x  command and then repeat for two more routers..despite the different default route configurations, they still will provide the same function after all correct routes are configured manually and redistributed dynamically so as long as they are not using a less popular routing protocol like IGRP. From what I read on the Cisco site, it said IGRP does not "understand" the 0.0.0.0 syntax in the ip route 0.0.0.0 0.0.0.0 s0/0/1 command so you have to use the default-network x.x.x.x command instaed...anyways...thanks for reading!    

                    • 7. Re: Setting Default Route
                      Chad Spears CCNP CCDA CCNAS

                      Wade-

                       

                      You got it... they preform the exact same function...they just go about it in different ways.

                       

                      Honestly, I have never tried the example you mentioned above... however looks like a good question for a lab. 

                       

                      I will start working on this. I am betting since each route will use its own default route... or default network statement.. and ignore the others.....why?  Well because when you pass off the route to other routers.  They will recieve that route with an AD of the IGP you are using.

                       

                      Man.....now that I read that......I am sure you are going to be just as confused as I am..... 

                       

                      Lets lab it up.  I will create a topology and post it here.

                       

                      HTH,
                      CS

                      • 8. Re: Setting Default Route
                        Devasi Alex

                        good

                        • 9. Re: Setting Default Route
                          Chad Spears CCNP CCDA CCNAS

                          Wade-

                           

                          So I have created a basic lab setup for this..

                           

                           

                          Lab-Demo.jpg

                           

                          This is the topology.   I will supply the outputs in a new post to this thread.  **Note**  I did not use the "Ip default-network" command in this demo...  You will see why in a second.

                           

                          HTH,

                          CS

                          • 10. Re: Setting Default Route
                            Chad Spears CCNP CCDA CCNAS

                            ****************R4*************************

                            interface Loopback0
                            ip address 4.4.4.4 255.255.255.0
                            !
                            interface Ethernet0/0
                            ip address 172.16.10.4 255.255.255.0
                            half-duplex
                            !
                            interface Serial0/0
                            no ip address
                            shutdown
                            !
                            interface Serial0/1
                            no ip address
                            shutdown
                            !
                            router eigrp 100
                            redistribute static
                            network 0.0.0.0
                            no auto-summary
                            !
                            ip http server
                            ip classless
                            ip route 0.0.0.0 0.0.0.0 4.4.4.1

                            ****************R2**************************

                            interface Loopback0
                            ip address 2.2.2.2 255.255.255.0
                            !
                            interface FastEthernet0/0
                            ip address 172.16.10.2 255.255.255.0
                            duplex auto
                            speed auto
                            !
                            interface Serial0/0
                            no ip address
                            shutdown
                            !
                            router eigrp 100
                            redistribute static
                            network 0.0.0.0
                            no auto-summary
                            !
                            ip http server
                            ip classless
                            ip route 0.0.0.0 0.0.0.0 2.2.2.1

                            **************show ip route R1****************

                            Gateway of last resort is 172.16.10.4 to network 0.0.0.0

                                 1.0.0.0/24 is subnetted, 1 subnets
                            C       1.1.1.0 is directly connected, Loopback0
                                 2.0.0.0/24 is subnetted, 1 subnets
                            D       2.2.2.0 [90/156160] via 172.16.10.2, 00:17:33, FastEthernet0/0
                                 3.0.0.0/24 is subnetted, 1 subnets
                            D       3.3.3.0 [90/156160] via 172.16.10.3, 00:17:09, FastEthernet0/0
                                 4.0.0.0/24 is subnetted, 1 subnets
                            D       4.4.4.0 [90/156160] via 172.16.10.4, 00:16:50, FastEthernet0/0
                                 172.16.0.0/24 is subnetted, 1 subnets
                            C       172.16.10.0 is directly connected, FastEthernet0/0
                            D*EX 0.0.0.0/0 [170/156160] via 172.16.10.4, 00:09:34, FastEthernet0/0
                                           [170/156160] via 172.16.10.2, 00:09:34, FastEthernet0/0

                            **************show ip route R3******************


                            Gateway of last resort is 172.16.10.4 to network 0.0.0.0

                                 1.0.0.0/24 is subnetted, 1 subnets
                            D       1.1.1.0 [90/156160] via 172.16.10.1, 00:19:43, FastEthernet0/0
                                 2.0.0.0/24 is subnetted, 1 subnets
                            D       2.2.2.0 [90/156160] via 172.16.10.2, 00:19:43, FastEthernet0/0
                                 3.0.0.0/24 is subnetted, 1 subnets
                            C       3.3.3.0 is directly connected, Loopback0
                                 4.0.0.0/24 is subnetted, 1 subnets
                            D       4.4.4.0 [90/156160] via 172.16.10.4, 00:19:25, FastEthernet0/0
                                 172.16.0.0/24 is subnetted, 1 subnets
                            C       172.16.10.0 is directly connected, FastEthernet0/0
                            D*EX 0.0.0.0/0 [170/156160] via 172.16.10.4, 00:12:10, FastEthernet0/0
                                           [170/156160] via 172.16.10.2, 00:12:10, FastEthernet0/0

                             

                             

                            So I am sure from the output above.... you could see where this may create an issue. What do you think?

                             

                            HTH,
                            CS

                            • 11. Re: Setting Default Route
                              WadeGerencser

                              Chad,

                               

                              This is hardcore. I have to be honest with you and I admit, I am lost. I do not see where the conflict will arrise. I am not sure what the D*EX means at the end of the ouputs of the sh ip route coammds for R1 and R3 respectivley. I dont know where to begin to look man. I feel bad cause I am about to take my ccna and this to me seems hard to interpret as to why it would cause conflits. Great example man.thats simply awesome~!

                              • 12. Re: Setting Default Route
                                Chad Spears CCNP CCDA CCNAS

                                Wade-

                                 

                                This is more CCNP level material.. but I know you will be there one day, from you post.. I can tell you have fallen in love with Cisco much like everybody on CLN.

                                 

                                The D*EX simply means it is a EIGRP External route with a AD of 170... the * means it is a canidate default route.  Or simply...any traffic that doesnt have a match in the routing table...will be sent to this route.

                                 

                                let me know if you need any help with any of your other CCNA Studies.

                                 

                                HTH,

                                CS

                                • 13. Re: Setting Default Route
                                  WadeGerencser

                                  Chad,

                                   

                                  I knew from the beginning your configurations on all the interfaces was spot on. I got passed that and I realized two things were apparent. Really though..my perception..I feel like R4 and R2 are going to be able to communicate fine. Then the I see that you don't have the configs for R1 and R3...then I again realized all the AS's were good on the diagram, R2 and R4..you have it all exact. Awesome. So.. I trust the other routers. Since you used the ip route 0.0.0.0 0.0.0.0 for R4 and R2 and assigned that virtual address to its loopback,  any traffic it does not have a route for, will be forwarded through the Loopback interface. It will not think like a default-network x.x.x.x command... Having nothing to view from the configs of R3 and R1, I feel like I am still "assuming" the default network x.x.x.x command on R1 and R3 does not have a lower AD than what EIGRP will propagate than what it knows about concerning R2 and R4. I say that weird broken sentence because I have to throw it out. I feel like I make sense of something here for sure..so here is my answer. The EIGRP D*EX output tells me it just chose the 172.16.0.4 cause its value is 0.0.0.0! Match everything? Gateway of last resort was 0.0.0.0 through 172.16.0.4 correct. I hope..then I would say..I get 75% I feel like this situation made me understand that a Gateway of Last Resort is more than just a static route or default route. Its the solution when both static and defaults are used and a decision must be made..and that's the gateway of last resort.

                                   

                                   

                                  Edit: Oops I did not mean forwarded through the loopback yikes so sorry!!!!!!! I get the lo concept. Ok...later : 0

                                   

                                  Holy smokes man..I know I have a lot more reading to do..and lab work. Its coming..and again..thanks for the kudos and detailed responses. Cisco is amazing. Most fun I have had in a long time!  

                                   

                                  Wade

                                  • 14. Re: Setting Default Route
                                    Diwakar Sharma -CCNA/CCNP/JNCIA-ER

                                    excellent explaination by chad spears