• 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.

cấu hình ip classless trong router ????

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

  • cấu hình ip classless trong router ????

    em có đọc một tài liệu nó nói về câu lệnh sau:

    R1(config)# ip classless
    các anh cho em hỏi là câu lệnh trên đây được dùng khi nào, và nó có tác dụng gì ?

  • #2
    * By using the ip classless command, you are overriding this behavior; you’re allowing your classful router to use a default route to reach discontiguous subnets.

    Mark
    * Classful protocols, such as IP RIPv1, understand only classful subnets—you can apply only one subnet mask to a class address.
    * Classless protocols, such as RIPv2, EIGRP, OSPF, and IS-IS, do not have this restriction. The ip classless command allows a classful protocol to use a default route; omitting this command will cause the router to drop packets that don’t match a specific destination network entry in the routing table.
    Ho Tuan Manh
    tuan_manh2001@yahoo.com

    Comment


    • #3
      nhưng mà cái em đọc trong mô hình lab ở đây nó lại cấu hình static route chứ không không có cái gì liên quan đên dynamic routing protocol. bác nào có thể lấy một ví dụ cho em hiểu rõ vấn đề này không ạ?

      Comment


      • #4
        Classless routing and classful routing relate to the logic used to match the routing table, specifically for when the default route is used. Regardless of the use of any optimized forwarding methods (for instance, CEF), the following statements are true about classless and classful routing:
        • Classless routing—When a default route exists, and no specific match is made when comparing the destination of the packet and the routing table, the default route is used.
        • Classful routing—When a default route exists, and the class A, B, or C network for the destination IP address does not exist at all in the routing table, the default route is used. If any part of that classful network exists in the routing table, but the packet does not match any of the existing subnets of that classful network, the router does not use the default route and thus discards the packet.

        Typically, classful routing works well in enterprise networks only when all the enterprise routes are known by all routers, and the default is used only to reach the Internet-facing routers. Conversely, for enterprise routers that normally do not know all the routes—for instance, if a remote router has only a few connected routes to network 10.0.0.0 and a default route pointing back to a core site— classless routing is required. For instance, in an OSPF design using stubby areas, default routes are injected into the non-backbone areas, instead of advertising all routes to specific subnets. As a result, classless routing is required in routers in the stubby area, because otherwise non-backbone area routers would not be able to forward packets to all parts of the network.
        CCIE#...Waiting...

        Comment


        • #5
          Chào bạn,

          Xem bài lab sau dây.

          Mô hình

          R1----R2

          R1
          interface FastEthernet0/0
          ip address 172.16.1.1 255.255.255.0
          ip route 0.0.0.0 0.0.0.0 172.16.1.2
          no ip classless


          R2
          interface FastEthernet0/0
          ip address 172.16.1.2 255.255.255.0
          duplex auto
          speed auto
          !
          interface FastEthernet0/1
          ip address 172.16.3.1 255.255.255.0
          duplex auto
          speed auto


          Ping từ R1 -> R2 (172.16.2.2)
          Router#ping 172.16.3.1

          Type escape sequence to abort.
          Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:
          !!!!!
          Success rate is 100 percent (5/5), round-trip min/avg/max = 8/50/88 ms


          Giờ trên router R1 thêm mạng 172.16.2.1 255.255.255.0
          interface FastEthernet0/1
          ip address 172.16.2.1 255.255.255.0


          R1#ping 172.16.3.1

          Type escape sequence to abort.
          Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:
          .....
          Success rate is 0 percent (0/5)


          Lí do vì sao vậy?



          Trên R1 hiện tại đang dùng classful.
          Trên R1 sẽ chỉ hiểu mạng 172.16.0.0/16 => bạn ping 172.16.3.1 (tức cũng là mạng con của 172.16.0.0/16), vậy nó đi ra connected của router (f0/1). Mạng nối với f0/1 của R1 không có IP nào là 172.16.3.1 nên R1 sẽ bỏ gói này.

          Giờ trên R1 ta dùng lại câu lệnh ip classless
          R1(config)#ip classless

          R1#ping 172.16.3.1

          Type escape sequence to abort.
          Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:
          !!!!!
          Success rate is 100 percent (5/5), round-trip min/avg/max = 8/35/68 ms




          Chú ý: các dòng router hiện tại mặc định đã bật sẵn câu lệnh ip classless nên vấn đề này đã được giải quyết.
          Last edited by phamminhtuan; 24-09-2010, 04:51 PM.
          Phạm Minh Tuấn

          Email : phamminhtuan@vnpro.org
          Yahoo : phamminhtuan_vnpro
          -----------------------------------------------------------------------------------------------
        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


        • #6
          thanks bác nhé. em lập cái topo lên rồi, và thấy ở có một bài viết chỗ này hay này anh
          IP Classless

          Where the ip classless configuration command falls within the routing and forwarding processes is often confusing. In reality, IP classless only affects the operation of the forwarding processes in IOS; it doesn't affect the way the routing table is built. If IP classless isn't configured (using the no ip classless command), the router won't forward packets to supernets. As an example, let's again place three routes in the routing table and route packets through the router.
          Note: If the supernet or default route is learned via IS-IS or OSPF, the no ip classless configuration command is ignored. In this case, packet switching behavior works as though ip classless were configured.
          router# show ip route ....
          172.30.0.0/16 is variably subnetted, 2 subnets, 2 masks
          D 172.30.32.0/20 [90/4879540] via 10.1.1.2
          D 172.30.32.0/24 [90/25789217] via 10.1.1.1
          S* 0.0.0.0/0 [1/0] via 10.1.1.3
          Remembering that the 172.30.32.0/24 network includes the addresses 172.30.32.0 through 172.30.32.255, and the 172.30.32.0/20 network includes the addresses 172.30.32.0 through 172.30.47.255, we can then try switching three packets through this routing table and see what the results are.
          • A packet destined to 172.30.32.1 is forwarded to 10.1.1.1, since this is the longest prefix match.
          • A packet destined to 172.30.33.1 is forwarded to 10.1.1.2, since this is the longest prefix match.
          • A packet destined to 192.168.10.1 is forwarded to 10.1.1.3; since this network doesn't exist in the routing table, this packet is forwarded to the default route.
          • A packet destined to 172.30.254.1 is dropped.

          The surprising answer out of these four is the last packet, which is dropped. It's dropped because its destination, 172.30.254.1, is within a known major network, 172.30.0.0/16, but the router doesn't know about this particular subnet within that major network.
          This is the essence of classful routing: If one part of a major network is known, but the subnet toward which the packet is destined within that major network is unknown, the packet is dropped.
          The most confusing aspect of this rule is that the router only uses the default route if the destination major network doesn't exist in the routing table at all.
          This can cause problems in a network where a remote site, with one connection back to the rest of the network, is running no routing protocols, as illustrated.

          The remote site router is configured like this:
          interface Serial 0 ip address 10.1.2.2 255.255.255.0 ! interface Ethernet 0 ip address 10.1.1.1 255.255.255.0 ! ip route 0.0.0.0 0.0.0.0 10.1.2.1 ! no ip classless
          With this configuration, the hosts at the remote site can reach destinations on the Internet (through the 10.x.x.x cloud), but not destinations within the 10.x.x.x cloud, which is the corporate network. Because the remote router knows about some part of the 10.0.0.0/8 network, the two directly connected subnets, and no other subnet of 10.x.x.x, it assumes these other subnets don't exist and drops any packets destined for them. Traffic destined to the Internet, however, doesn't ever have a destination in the 10.x.x.x range of addresses, and is therefore correctly routed through the default route.
          Configuring ip classless on the remote router resolves this problem by allowing the router to ignore the classful boundaries of the networks in its routing table and simply route to the longest prefix match it can find.
          Last edited by duylinh; 24-09-2010, 07:32 PM.

          Comment


          • #7
            Originally posted by phamminhtuan View Post
            Chào bạn,

            Xem bài lab sau dây.

            Mô hình

            R1----R2

            R1
            interface FastEthernet0/0
            ip address 172.16.1.1 255.255.255.0
            ip route 0.0.0.0 0.0.0.0 172.16.1.2
            no ip classless


            R2
            interface FastEthernet0/0
            ip address 172.16.1.2 255.255.255.0
            duplex auto
            speed auto
            !
            interface FastEthernet0/1
            ip address 172.16.3.1 255.255.255.0
            duplex auto
            speed auto


            Ping từ R1 -> R2 (172.16.2.2)
            Router#ping 172.16.3.1

            Type escape sequence to abort.
            Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:
            !!!!!
            Success rate is 100 percent (5/5), round-trip min/avg/max = 8/50/88 ms


            Giờ trên router R1 thêm mạng 172.16.2.1 255.255.255.0
            interface FastEthernet0/1
            ip address 172.16.2.1 255.255.255.0


            R1#ping 172.16.3.1

            Type escape sequence to abort.
            Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:
            .....
            Success rate is 0 percent (0/5)


            Lí do vì sao vậy?



            Trên R1 hiện tại đang dùng classful.
            Trên R1 sẽ chỉ hiểu mạng 172.16.0.0/16 => bạn ping 172.16.3.1 (tức cũng là mạng con của 172.16.0.0/16), vậy nó đi ra connected của router (f0/1). Mạng nối với f0/1 của R1 không có IP nào là 172.16.3.1 nên R1 sẽ bỏ gói này.

            Giờ trên R1 ta dùng lại câu lệnh ip classless
            R1(config)#ip classless

            R1#ping 172.16.3.1

            Type escape sequence to abort.
            Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:
            !!!!!
            Success rate is 100 percent (5/5), round-trip min/avg/max = 8/35/68 ms


            Chú ý: các dòng router hiện tại mặc định đã bật sẵn câu lệnh ip classless nên vấn đề này đã được giải quyết.
            @thầy Tuấn, em thấy giải thích của thầy nó hơi rối rắm và lủng củng, thấy có thể xác định rõ cái mô hình của thầy và vị trí các cổng đặt IP không ? em hình dung cái mô hình của thấy như hình dưới:

            Ban đầu thầy nói R1, có f0/0 là 172.16.1.1, f0/1 chưa cấu hình, còn R2 có f0/0 là 172.16.1.2, f0/1 là 172.16.3.1, rồi sau đó thầy nói
            Ping từ R1 -> R2 (172.16.2.2)
            Router#ping 172.16.3.1
            Lúc này mạng 172.16.2.2 ờ đâu ra trong khi mãi sau đó thầy mới thêm f0/1 trên R1 là 172.16.2.1 ?

            Nói chung em vẫn chưa hình dung ra thấy giải thích ip classless là gì? thầy hơi kiệm lời hay do em chậm hiểu, haaiiizzz
            Attached Files

            Comment

            • Working...
              X