• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

Khảo sát một số vấn đề về default-route trong routing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Khảo sát một số vấn đề về default-route trong routing

    3 lệnh :

    IP default-network x.x.x.x
    IP route 0.0.0.0 0.0.0.0 x.x.x.x
    IP default-gateway x.x.x.x

    Lệnh nào khi dùng kèm với lệnh Default-information orriginated trogn 1 routing protocol sẽ inject cái default-route vào trong routing update?
    -------------------------------------------------------
    Yamaha R6 Rider
    Tôi là Yuna_admirer.

  • #2
    Re: Default information orriginated

    IP route 0.0.0.0 0.0.0.0 x.x.x.x :D

    Comment


    • #3
      Bạn có thể dùng default information originate always . Lệnh này không cần dùng kèm với ip route 0.0.0.0 0.0.0.0 x.x.x.x .

      Chúc vui !

      Comment


      • #4
        Re: Default information orriginated

        Originally posted by TGA_Certificationteam
        3 lệnh :

        IP default-network x.x.x.x
        IP route 0.0.0.0 0.0.0.0 x.x.x.x
        IP default-gateway x.x.x.x

        Lệnh nào khi dùng kèm với lệnh Default-information orriginated trogn 1 routing protocol sẽ inject cái default-route vào trong routing update?
        TGA,

        Lệnh IP default-gateway chỉ dùng khi quá trình routing bị DISABLE.
        Cả hai lệnh còn lại, ip default-network và ip route 0.0.0.0 0.0.0.0 xxxx đều sẽ lan truyền default-route về các down-stream router.
        Cách mà các routing protocol lan truyền default-route rất khác nhau.


        chúc TGA thành công,
        -----------------------------------
        ip default-gateway

        The ip default-gateway command differs from the other two commands in that it should only be used when ip routing is disabled on the Cisco router.

        For instance, if the router is a host in the IP world, you can use this command to define a default gateway for it. You might also use this command when your low end Cisco router is in boot mode in order to TFTP a Cisco IOS® Software image to the router. In boot mode, the router does not have ip routing enabled.

        ip default-network

        Unlike the ip default-gateway command, you can use ip default-network when ip routing is enabled on the Cisco router. When you configure ip default-network the router considers routes to that network for installation as the gateway of last resort on the router.

        For every network configured with ip default-network, if a router has a route to that network, that route is flagged as a candidate default route. Look at the following routing table taken from a Cisco router:

        2513#show ip route
        Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
        Gateway of last resort is not set
        161.44.0.0 255.255.255.0 is subnetted, 1 subnets
        C 161.44.192.0 is directly connected, Ethernet0
        S 198.10.1.0 [1/0] via 161.44.192.2
        131.108.0.0 255.255.255.0 is subnetted, 1 subnets
        C 131.108.99.0 is directly connected, TokenRing0

        Note the static route to 198.10.1.0 via 161.44.192.2 and that the gateway of last resort is not set. If you configure ip default-network 198.10.1.0, the routing table changes to the following:

        2513#show ip route
        Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

        Gateway of last resort is 161.44.192.2 to network 198.10.1.0

        161.44.0.0 255.255.255.0 is subnetted, 1 subnets
        C 161.44.192.0 is directly connected, Ethernet0
        S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
        S* 198.10.1.0 [1/0] via 161.44.192.2
        131.108.0.0 255.255.255.0 is subnetted, 1 subnets
        C 131.108.99.0 is directly connected, TokenRing0
        2513#show ip protocols
        2513#

        You can see the gateway of last resort has now been set as 161.44.192.2. This result is independent of any routing protocol, as shown by the show ip protocols command at the bottom of the output.

        You can add another candidate default route simply by configuring another instance of ip default-network:

        2513#config terminal
        Enter configuration commands, one per line. End with CNTL/Z.
        2513(config)#ip route 171.70.24.0 255.255.255.0 131.108.99.2
        2513(config)#ip default-network 171.70.24.0
        2513(config)#^Z

        2513#show ip route
        Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

        Gateway of last resort is 161.44.192.2 to network 198.10.1.0

        161.44.0.0 255.255.255.0 is subnetted, 1 subnets
        C 161.44.192.0 is directly connected, Ethernet0
        S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
        S* 198.10.1.0 [1/0] via 161.44.192.2
        171.70.0.0 is variably subnetted, 2 subnets, 2 masks
        S 171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
        S 171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
        131.108.0.0 255.255.255.0 is subnetted, 1 subnets
        C 131.108.99.0 is directly connected, TokenRing0

        Notice that after entering the above command, the network was not flagged as a default network. The following section explains why.

        Flagging a Default Network

        Note: The ip default-network command is classful, which means if the router has a route to the subnet indicated by this command, it installs the route to the major net. At this point neither network has been flagged as the default network. The ip default-network command must be issued again, using the major net, in order to flag the candidate default route.

        2513#config terminal
        Enter configuration commands, one per line. End with CNTL/Z.
        2513(config)#ip default-network 171.70.0.0
        2513(config)#^Z

        2513#show ip route
        Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

        Gateway of last resort is 161.44.192.2 to network 198.10.1.0

        161.44.0.0 255.255.255.0 is subnetted, 1 subnets
        C 161.44.192.0 is directly connected, Ethernet0
        S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
        S* 198.10.1.0 [1/0] via 161.44.192.2
        171.70.0.0 is variably subnetted, 2 subnets, 2 masks
        S* 171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
        S 171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
        131.108.0.0 255.255.255.0 is subnetted, 1 subnets
        C 131.108.99.0 is directly connected, TokenRing0
        If the original static route had been to the major network, the extra step of configuring the default network twice would not have been necessary.

        There are still no IP protocols running here. Without any dynamic protocols running, you can configure your router to choose from a number of candidate default routes based on whether the routing table has routes to networks other than 0.0.0.0/0. This command allows you to configure robustness into the selection of a gateway of last resort. Rather than configuring static routes to specific next-hops, you can have the router choose a default route to a particular network by checking in the routing table.

        If you lose the route to a particular network, the router selects the second candidate default, as specified above. You can remove the lost route by removing the static route in the configuration as follows:

        2513#config terminal
        Enter configuration commands, one per line. End with CNTL/Z.
        2513(config)#no ip route 198.10.1.0 255.255.255.0 161.44.192.2
        2513(config)#^Z
        2513#
        %SYS-5-CONFIG_I: Configured from console by console
        After removing the static route to the original default network, the routing table looks like this:

        2513#show ip route
        Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

        Gateway of last resort is 171.70.24.0 to network 171.70.0.0

        161.44.0.0 255.255.255.0 is subnetted, 1 subnets
        C 161.44.192.0 is directly connected, Ethernet0
        S 161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0
        * 171.70.0.0 is variably subnetted, 2 subnets, 2 masks
        S* 171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
        S 171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
        131.108.0.0 255.255.255.0 is subnetted, 1 subnets
        C 131.108.99.0 is directly connected, TokenRing0
        2513#

        Using Different Routing Protocols

        Gateways of last resort selected using the ip default-network command are propagated differently depending on which routing protocol is propagating the default route. For IGRP and EIGRP to propagate the route, the network specified by the ip default-network command must be known to IGRP or EIGRP. This means the network must be an IGRP- or EIGRP-derived network in the routing table, or the static route used to generate the route to the network must be redistributed into IGRP or EIGRP.

        RIP advertises a route to 0.0.0.0. For example, note that the gateway of last resort on the router below was learned using the combination of the ip route and ip default-network commands. If you enable RIP on this router, RIP advertises a route to 0.0.0.0 (although not to the Token Ring network because of split-horizon):

        2513(config)#router rip
        2513(config-router)#network 161.44.0.0
        2513(config-router)#network 131.108.0.0
        2513(config-router)#^Z
        2513#
        2513#
        2513#
        %SYS-5-CONFIG_I: Configured from console by console
        2513#debug ip rip
        RIP protocol debugging is on
        2513#
        RIP: sending update to 255.255.255.255 via Ethernet0 (161.44.192.1)
        default 0.0.0.0, metric 1
        network 131.108.0.0, metric 1
        RIP: sending update to 255.255.255.255 via TokenRing0 (131.108.99.1)
        network 161.44.0.0, metric 1
        2513#

        Note: In IOS release 12.0T and later, RIP does not advertise the default router if the route is not learned via RIP. Therefore, it may be necessary to redistribute the route into RIP, or use the default-information originate command.

        OSPF, like RIP, advertises a route for 0.0.0.0 0.0.0.0. However, with OSPF, the router originating the default route must be configured with the default-information originate command. For more detailed information, see How Does OSPF Generate Default Routes?.

        ip route 0.0.0.0 0.0.0.0

        Creating a static route to network 0.0.0.0 0.0.0.0 is another way to set the gateway of last resort on a router. As with the ip default-network command, using the static route to 0.0.0.0 is not dependent on any routing protocols. However, ip routing must be enabled on the router.

        Note: IGRP does not understand a route to 0.0.0.0, therefore it cannot propagate default routes created using the ip route 0.0.0.0 0.0.0.0 command. Use the ip default-network command to have IGRP propagate a default route.

        EIGRP propagates a route to network 0.0.0.0, but the static route must be redistributed into EIGRP. RIP and OSPF behave as described when using the ip default-network command. Keep in mind that the note above still applies.

        Look at an example of configuring a gateway of last resort using the ip route 0.0.0.0 0.0.0.0 command:

        router-3#conf terminal
        Enter configuration commands, one per line. End with CNTL/Z.
        router-3(config)#ip route 0.0.0.0 0.0.0.0 170.170.3.4
        router-3(config)#^Z
        router-3#

        router-3#show ip route
        Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
        U - per-user static route, o - ODR

        Gateway of last resort is 170.170.3.4 to network 0.0.0.0

        170.170.0.0/24 is subnetted, 2 subnets
        C 170.170.2.0 is directly connected, Serial0
        C 170.170.3.0 is directly connected, Ethernet0
        S* 0.0.0.0/0 [1/0] via 170.170.3.4
        router-3#
        router-3#
        Note: If you configure multiple networks as candidate default routes using the ip default-network command, the network that has the lowest administrative distance is chosen as the network for the gateway of last resort. If all the networks have the same administrative distance then the network listed first in the routing table (show ip route lists the routing table) is chosen as the network for the gateway of last resort. If you use both the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to configure candidate default networks, and the network used by the ip default-network command is known statically, the network defined with the ip default-network command takes precedence and is chosen for the gateway of last resort. Otherwise if the network used by the ip default-network command is derived by a routing protocol, the ip route 0.0.0.0 0.0.0.0 command, which will have a lower administrative distance, takes precedence and is chosen for the gateway of last resort. Lastly, if you use multiple ip route 0.0.0.0 0.0.0.0 commands to configure a default route, traffic is load-balanced over the multiple routes.

        Summary

        To summarize, you can use the ip default-gateway command when ip routing is disabled on a Cisco router. Use the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to set the gateway of last resort on Cisco routers that have ip routing enabled. The way in which routing protocols propagate the default route information varies for each protocol.

        Comment


        • #5
          Đặt Gateway of Last Resort bằng các lệnh IP

          Bài viết này hướng dẫn cách dùng các câu lệnh: ip default−gateway, ip default−network , and ip route 0.0.0.0 0.0.0.0 để cấu hình default route, hay gateway of last resort.

          ip default−gateway
          Lệnh ip default−gateway chỉ dùng khi disable ip routing trên router Cisco. Nếu một router trong mạng, có thể dùng lệnh này để định nghĩa ngõ ra mặc định cho nó. Cũng có thể dùng lệnh này để TFTP một image cho router khi ở boot mode.


          ip default−network
          Không như lệnh ip default-gateway , có thể dùng lệnh ip default-network khi ip routing đã enable trên router. Khi thực hiện lệnh này, router xem như route tới mạng đó đặt là ngõ ra cuối cùng (gateway of last resort) trên router.
          Đối với mỗi mạng đã cấu hình ip default-network, nếu một router có route cho mạng đó, thì route đó được đánh dấu là candidate default. Xem bảng định tuyến trên router Cisco sau:

          Code:
          2513#show ip route
          Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
                 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
                 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
                 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
          Gateway of last resort is not set
               161.44.0.0 255.255.255.0 is subnetted, 1 subnets
          C       161.44.192.0 is directly connected, Ethernet0
          S    198.10.1.0 [1/0] via 161.44.192.2
               131.108.0.0 255.255.255.0 is subnetted, 1 subnets
          C       131.108.99.0 is directly connected, TokenRing0
          Nếu cấu hình ip default-network 198.10.1.0 trên router thì bảng định tuyến thay đổi như sau:

          Code:
          2513#show ip route
          ...
          Gateway of last resort is 161.44.192.2 to network 198.10.1.0
           
               161.44.0.0 255.255.255.0 is subnetted, 1 subnets
          C       161.44.192.0 is directly connected, Ethernet0
          S       161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0 
          S*    198.10.1.0 [1/0] via 161.44.192.2
               131.108.0.0 255.255.255.0 is subnetted, 1 subnets
          C       131.108.99.0 is directly connected, TokenRing0
          2513#show ip protocols
          2513#
          Như vậy có thể thấy gateway of last resort đựơc đặt là 161.44.192.2. Kết quả này không phụ thuộc bất kỳ giao thức định tuyến nào.

          Có thể thêm một route candidate default đơn giản bằng cách cấu hình ip default-network khác.

          Code:
          2513#config terminal
          Enter configuration commands, one per line.  End with CNTL/Z.
          2513(config)#ip route 171.70.24.0 255.255.255.0 131.108.99.2
          2513(config)#ip default-network 171.70.24.0
          2513(config)#^Z
          
          2513#show ip route
          ...
           
          Gateway of last resort is 161.44.192.2 to network 198.10.1.0
           
               161.44.0.0 255.255.255.0 is subnetted, 1 subnets
          C    161.44.192.0 is directly connected, Ethernet0
          S    161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0 
          S*   198.10.1.0 [1/0] via 161.44.192.2
               171.70.0.0 is variably subnetted, 2 subnets, 2 masks
          S    171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
          S    171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
               131.108.0.0 255.255.255.0 is subnetted, 1 subnets
          C    131.108.99.0 is directly connected, TokenRing0
          Chú ý, sau khi thực hiện lệnh trên, mạng không được đánh dấu là default network. Phần sau đây sẽ giải thích tại sao.


          Đánh dấu một default network
          Chú ý: Lệnh ip default-network là classfull, nghĩa là nếu router có một route tới mạng con chỉ bởi lệnh này, nó đặt route về major net. Lúc này không mạng nào mạng được đánh dấu là default network. Lệnh ip default-network phải đựơc đặt lại dùng major net, để đánh dấu route là candidate default.

          Code:
          2513#config terminal
          Enter configuration commands, one per line. End with CNTL/Z. 
          2513(config)#ip default-network 171.70.0.0
          2513(config)#^Z
          
          2513#show ip route
          Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
                 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
                 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
                 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
           
          Gateway of last resort is 161.44.192.2 to network 198.10.1.0
           
                  161.44.0.0 255.255.255.0 is subnetted, 1 subnets
          C       161.44.192.0 is directly connected, Ethernet0
          S       161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0 
          S*      198.10.1.0 [1/0] via 161.44.192.2
                  171.70.0.0 is variably subnetted, 2 subnets, 2 masks
          S*      171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
          S       171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
                  131.108.0.0 255.255.255.0 is subnetted, 1 subnets
          C       131.108.99.0 is directly connected, TokenRing0
          Ở đây vẫn chưa chạy giao thức IP. Không có chạy giao thức định tuyến động, có thể cấu hình router chọn từ một số route candidate default dựa trên bảng định tuyến. Lệnh này cho phép cấu hình thẳng vào phần gateway of last resort. Hơn là cấu hình static roue tới chặng kế nào đó, có thể router chọn default route tới mạng nào đó bằng cách kiểm tra bảng định tuyến.

          Nếu route tới mạng bị mất, router chọn candidate default thứ hai. Có thể lọai bỏ route hỏng bằng cách loại static route như cấu hình dưới đây:

          Code:
          2513#config terminal
          Enter configuration commands, one per line.  End with CNTL/Z.
          2513(config)#no ip route 198.10.1.0 255.255.255.0 161.44.192.2
          2513(config)#^Z
          2513#
          %SYS-5-CONFIG_I: Configured from console by console
          
          
          2513#show ip route
          Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
                 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
                 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
                 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
           
          Gateway of last resort is 171.70.24.0 to network 171.70.0.0
           
               161.44.0.0 255.255.255.0 is subnetted, 1 subnets
          C       161.44.192.0 is directly connected, Ethernet0
          S       161.44.0.0 255.255.0.0 [1/0] via 161.44.192.0 
          *   171.70.0.0 is variably subnetted, 2 subnets, 2 masks
          S*      171.70.0.0 255.255.0.0 [1/0] via 171.70.24.0
          S       171.70.24.0 255.255.255.0 [1/0] via 131.108.99.2
               131.108.0.0 255.255.255.0 is subnetted, 1 subnets
          C       131.108.99.0 is directly connected, TokenRing0
          2513#
          Dùng các giao thức định tuyến khác

          Gateways of last resort được chọn bằng lệnh ip default-network truyền đi khác nhau phụ thuộc vào giao thức định tuyến nào sẽ lan truyền default route. Với IGRP va EIGRP để lan truyền route, mạng xác định bởi lệnh ip default-network phải biết bởi IGRP hay EIGRP. Có nghĩa là mạng phải một mạng học được từ IGRP hay EIGRP trong bảng định tuyến, hay static route dùng để tạo route phải được redistribute vào IGRP hay EIGRP.

          RIP quảng cáo route 0.0.0.0. Ví dụ, giả sử gateway of last resort trên router học được thông qua lệnh ip route và ip default-network, nếu chạy RIP trên router này, RIP sẽ quảng cáo route thành 0.0.0.0

          Code:
          2513(config)#router rip
          2513(config-router)#network 161.44.0.0
          2513(config-router)#network 131.108.0.0
          2513(config-router)#^Z
          2513#
          2513#
          2513#
          %SYS-5-CONFIG_I: Configured from console by console
          2513#debug ip rip
          RIP protocol debugging is on
          2513#
          RIP: sending update to 255.255.255.255 via Ethernet0 (161.44.192.1)
               default 0.0.0.0, metric 1
               network 131.108.0.0, metric 1
          RIP: sending update to 255.255.255.255 via TokenRing0 (131.108.99.1)
          network 161.44.0.0, metric 1
          2513#
          Trong IOS release 12.0T và later, RIP không quảng cáo default route nếu route đó không được học từ RIP. Do đó, cần phải redistribute route này vào RIP, hay sử dụng lệnh default-information originate .

          OSPF, giống như RIP, quảng cáo route cho 0.0.0.0 0.0.0.0. Tuy nhiên, với OSPF, router là nguồn của default route phải được cấu hình bằng lệnh default-information originate


          ip route 0.0.0.0 0.0.0.0

          Tạo static route tới mạng 0.0.0.0 0.0.0.0 là một cách khác để đặt gateway of last resort trên một router. Như đối với lệnh ip default-network, sử dụng static route tới 0.0.0.0 không phụ thuộc vào giao thức định tuyến. Tuy nhiên, ip routing phải được enable trên router.

          Chú ý: IGRP không hiểu route tới 0.0.0.0, do đó nó không thể truyền các default route tạo bằng lệnh ip route 0.0.0.0 0.0.0.0 . Dùng lệnh ip default-network để được IGRP truyền default route.

          EIGRP lan truyền thông tin route tới mạng 0.0.0.0, nhưng static route phải được redistribute vào EIGRP. RIP và OSPF cư xử như đã mô tả khi dùng lệnh ip default-network.

          Xem ví dụ sau, cấu hình gateway of last resort dùng lệnh ip route 0.0.0.0 0.0.0.0

          Code:
          router-3#conf terminal
             Enter configuration commands, one per line. End with CNTL/Z.
             router-3(config)#ip route 0.0.0.0 0.0.0.0 170.170.3.4
             router-3(config)#^Z
             router-3#
             
             router-3#show ip route
             Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
             D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
             N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
             E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
             i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
             U - per-user static route, o - ODR
          
          Gateway of last resort is 170.170.3.4 to network 0.0.0.0
          
           170.170.0.0/24 is subnetted, 2 subnets
             C 170.170.2.0 is directly connected, Serial0
             C 170.170.3.0 is directly connected, Ethernet0
             S* 0.0.0.0/0 [1/0] via 170.170.3.4
             router-3#
             router-3#

          Chú ý:
          - Nếu cấu hình nhiều mạng là candidate default route sử dụng lệnh ip default-network, mạng có AD nhỏ nhất sẽ được chọn là mạng cho gateway of last resort.
          - Nếu tất cả các mạng có cùng AD thì mạng được liệt kê đầu tiên trong bảng định tuyến sẽ đựơc chọn là mạng cho gateway of last resort.
          - Nếu dùng cả hai lệnh ip default-network và ip route 0.0.0.0 để cấu hình candidate default network, và mạng dùng bởi ip default-network biết bằng static route, mạng định nghĩa bằng lệnh ip default-network sẽ được xem xét trước và đựơc chọn cho gateway of last resort. Ngược lại nếu mạng dùng bởi ip default-network biềt được bằng giao thức định tuyến, lệnh ip route 0.0.0.0 0.0.0.0 , có AD nhỏ hơn, sẽ được ưu tiên và được chọn là gateway of last resort.
          - Cuối cùng, nếu dùng nhiều lệnh ip route 0.0.0.0 0.0.0.0 để cấu hình default route, dữ liệu sẽ được load-balance trên các route.


          Tóm lại
          - Sử dụng ip default-gateway khi vô hiệu hoá ip routing trên router Cisco.
          - Dùng lệnh ip default-network và ip route 0.0.0.0 0.0.0.0 để đặt gateway of last resort trên các router Cisco có enable ip routing.
          - Các thức các giao thức định tuyến truyền thông tin default route khác nhau đối với mỗi giao thức.


          :D
          ---------------------
          Trích dịch từ CCO:

          Comment


          • #6
            Hi all,
            Mình có một problem liên quan đến vấn đề này. Mình thử cấu hình trên router 2514 câu lệnh ip default-network 192.168.1.0. Bảng định tuyến như sau:

            Gateway of last resort is not set

            C* 192.168.1.0 is directly connected, Serial 0

            Với kết quả này, mình không thể sử dụng 192.168.1.0/24 làm tuyến mặc định được. Nếu dùng ip route 0.0.0.0 0.0.0.0 192.168.1.2 thì hoạt động tốt. Mình còn thiếu điều gì chăng?

            Mong được giúp đỡ.

            Comment


            • #7
              hi netdevice,

              ip default-network chỉ apply cho IGRP/EIGRP. Với RIP, nó có thể phụ thuộc vào IOS version.

              netdevice dùng routing protocol gì?

              Thân,
              Đặng Quang Minh, CCIEx2#11897 (Enterprise Infrastructure, Wireless), DEVNET, CCSI#31417

              Email : dangquangminh@vnpro.org
              https://www.facebook.com/groups/vietprofessional/

              Comment


              • #8
                hi anh Minh,
                Em thử cả 2 IGRP và RIP đều không được. Nhưng em nghĩ giao thức định tuyến đâu có liên quan đến điều này vì em muốn tạo một tuyến mặc định bằng ip default-network để có thể ping interface loopback của 1 router kết nối trực tiếp. Router 2514 có IOS 12.1.
                Thanks.

                Comment


                • #9
                  Re: Đặt Gateway of Last Resort bằng các lệnh IP

                  netdevice,

                  Xem file đính kèm. Chú ý đến từng chi tiết.

                  Cấu hình này đã được test nhiều lần và working.

                  Thân,
                  Email : vnpro@vnpro.org
                  ---------------------------------------------------------------------------------------------------------------
                Trung Tâm Tin Học VnPro
                149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
                Tel : (08) 35124257 (5 lines)
                Fax: (08) 35124314

                Home page: http://www.vnpro.vn
                Support Forum: http://www.vnpro.org
                - Chuyên đào tạo quản trị mạng và hạ tầng Internet
                - Phát hành sách chuyên môn
                - Tư vấn và tuyển dụng nhân sự IT
                - Tư vấn thiết kế và hỗ trợ kỹ thuật hệ thống mạng

                Network channel: http://www.dancisco.com
                Blog: http://www.vnpro.org/blog

                Comment


                • #10
                  hi,

                  Bạn thử cấu hình như sau xem thử có chạy được không.

                  ip route 192.168.1.0 255.255.255.0 192.168.1.2
                  ip default-network 192.168.1.0

                  Comment


                  • #11
                    Khảo sát một số vấn đề về default-route trong routing

                    Wow, dạo này các bài thảo luận ở box routing rất hay :wink: .

                    Default route là một vấn đề cũng có rất nhiều bài thảo luận như gateway of last resort, default network...

                    Tuy nhiên mình có một số câu hỏi sau:

                    1. Khi sử dụng default route hay default network với RIP, nên sử dụng định tuyến dạng classfull hay classless (why?)

                    2. Trong IGRP, khi cấu hình ip default-network, có phải major network là network nào cũng được ko?

                    3. EIGRP xem route 0.0.0.0/0 như là default route, lệnh ip default-network cũng chỉ ra default route, vậy đâu là điểm khác biệt?

                    4. Trong OSPF, default route giữa NSSA ASBR và NSSA ABR có khác biệt gì, cấu hình như thế nào?

                    Thanks,

                    Comment


                    • #12
                      (1) RIPv1 là classful routing protocol, nhưng router chạy giao thức này có thể hiểu classless bằng lệnh ip classless (chú ý đây là router, chứ bản thân RIPv1 không có khả năng quảng bá SM trong bản tin cập nhật định tuyến)

                      RIPv2 là classless routing protocol, hiển nhiên hỗ trợ CIDR và VLSM.

                      Không hiểu ý câu hỏi ở đây là gì? classful theo nghĩa RIP1 và classless theo nghĩa RIP2, hay đang muốn nói đến việc chọn lựa giữa RIP1 với tính năng ip classless??

                      (2) Ý câu hỏi này có phải nói đến vấn đề discontigous network khi cấu hình ip default trong IGRP?? hay major network mà supmod nói đến chính là tham số trong câu lệnh ip default-network ip-network-address ??

                      Nếu là vấn đề discontigous net, và giải quyết bằng ip default-network, thì 1''hpSky cho rằng có thể thực hiện với major network bất kỳ.

                      (3) default network là giải pháp giảm thiểu kích thước bảng định tuyến dựa trên nguyên tắc gateway of last resort. Khác với static route, default route được include trong bản tin cập nhật định tuyến.

                      Có hai cách để thực hiện default-network: lệnh ip route 0.0.0.0/0 và ip default-network. Không hiểu câu hỏi có phải nói về sự khác biệt hai lệnh này??

                      (4) Mình cũng đang thắc mắc.

                      Thiển nghĩ,
                      1\'\'hpSky
                      If only I could turn back time...

                      Comment


                      • #13
                        Re: Một số câu hỏi về default route

                        Hi Neo,

                        1,2&3. Neo xem file đính kèm nha.
                        4. NSSA chấp nhận LSAs type 7 (format giống type 5) nhưng kô flood trong toàn miền OSPF mà convert sang LSAs type 5 trước khi quảng bá đến các miền (area) khác.

                        Chúc Neo vui,

                        Comment


                        • #14
                          Re: Một số câu hỏi về default route

                          (1) ''hpSky, nghĩa là traffic có gửi đến default route hay không trong trường hợp ip classless và no ip classless?

                          (2) Theo cái link của themask thì lệnh ip default-network được dùng để chỉ định major network và đánh dấu mạng này là default network, major network phải là connected, và có hiệu lực khi network này tồn tại trong routing table.

                          (3) EIGRP có một điểm khác biệt cơ bản so với IGRP là EIGRP xem route 0.0.0.0/0 như là default route còn IGRP thì không.

                          (4) Cấu hình tạo default summary route vào NSSA area: (config-router)# area 1 nssa no-summary
                          Cấu hình Type 7 Default vào NSSA area: (config-router)# area 1 nssa default-information-originate

                          Comment


                          • #15
                            Originally posted by netdevice
                            Hi all,
                            Mình có một problem liên quan đến vấn đề này. Mình thử cấu hình trên router 2514 câu lệnh ip default-network 192.168.1.0. Bảng định tuyến như sau:

                            Gateway of last resort is not set

                            C* 192.168.1.0 is directly connected, Serial 0

                            Với kết quả này, mình không thể sử dụng 192.168.1.0/24 làm tuyến mặc định được. Nếu dùng ip route 0.0.0.0 0.0.0.0 192.168.1.2 thì hoạt động tốt. Mình còn thiếu điều gì chăng?

                            Mong được giúp đỡ.
                            Đối với IGRP, lệnh #ip route 0.0.0.0 0.0.0.0 192.168.1.2 chỉ có tác dụng đặt gateway of last resort cho chính mình, nó không truyền default route này cho các router khác trong mạng.
                            lệnh #ip default-network 192.16.1.0 lại chỉ có tác dụng thông báo cho các router khác về một default-route, chứ không có tác dụng đặt con đường mặc định cho chính mình, vì thế
                            khi #show ip route thấy "gateway of last resoft is not set"

                            ( IGRP does not recognize the network 0.0.0.0/0 and will not include it in update, you must you command:#ip default-network)

                            Như vậy đối với các router IGRP "cổng" cần gõ cả 2 lệnh:
                            #ip route 0.0.0.0 0.0.0.0 192.168.1.2 và
                            #ip default-network 192.168.1.0

                            Đối với RIP thì nó hiểu được route 0.0.0.0/0 và các update của nó chứa cả route này nên chỉ cần gõ 1 lệnh: #ip route 0.0.0.0 0.0.0.0 192.168.1.2 là đủ.

                            ý kiến nhỏ!
                            1'hpSky!

                            Comment

                            • Working...
                              X