What are the differences between ip classless and no ip classless for default routing?

Source: Internet
Author: User

The difference between ip classless and no ip classless for default routing is as follows: R3 (config) # no ip classlessR3 # show ip route <cut> Gateway of last resort is 168.13.1.101 to network 0.0.0.0 168.13.0.0/24 is subnetted, 4 subnetsR 168.13.1.0 [120/1] via 168.13.100.1, 00:00:13, serial0/1C 168.13.3.0 is directly connected, Ethernet0R 168.13.2.0 [120/1] via 168.13.100.2, 00:00:06, Serial0/1C 168.13.100.0 is directly connected, Serial0.1S * 0.0.0. 0/0 [1/0] via 168.13.1.101 first: ping 10.1.1.1R3 # ping 10.1.1.1Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds :!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 84/89/114 msR3 # ping 168.13.200.1 R3 # ping 168.13.200.1Type escape sequence to abort. sending 5, 100-byte ICMP Echos to 168.13.200.1, timeout is 2 seconds :... success rate is 0 percent (0/5) opposite: R3 (config) # ip classlessR3 # ping 10.1.1.1Type escape sequence to abort. sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds :!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 84/89/114 msR3 # ping 168.13.200.1R3 # ping 168.13.200.1Type escape sequence to abort. sending 5, 100-byte ICMP Echos to 168.13.200.1, timeout is 2 seconds :!!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 80/88/round msr3 # Why? The reason is as follows: ip classless enables classless routing. When the ip classless command is disabled, the router only looks at the main class entries in the route table when querying the route. In earlier versions of Cisco, IOS disabled the command by default. This is why the following entries appear in the route table of the cisco router: 1.0.0.0/32 is subnetted, 1 subnetsC 1.1.1.1 is directly connected, loopback0 172.30.0.0/24 is subnetted, 1 subnetsC 172.30.1.0 is directly connected, Ethernet0 does not actually enable ip classless, Cisco Route table will always be similar to "172.30.0.0/24 is subnetted, 1 subnets "Main class entry, it shows that the network is divided by a 24-bit mask subnet (and then list the specific subnet ), this is because Cisco Software treats IPv4 subnets by category early. (At that time, query routes only look at the primary class number, not the specific subnet number ). When ping 168.13.200.1, The vro finds that the vro belongs to the network segment 168.13.0.0. Then, it searches for the route within the network segment and finds that no matching match is found. Then discard it! Therefore, ping fails. However, when ping 10.1.1.1, The vro finds that it belongs to the-type network, finds the route table, and does not find the entry of the-type network, so it is handed over to the default route! After ip classless is enabled, the cisco router regards IPv4 as classless and compares the subnet number when searching for a route. Find down. If no, the default route is used. That is, after the ip classless is disabled, first find the standard ABC network segment that you belong to. There are two situations: 1. If you find the standard CIDR block that you belong to, then you will be confined to this standard CIDR block to see if there is any one that meets your needs. If yes, you will succeed. If not, you will discard it. The default route is not used. 2. If you cannot find the standard CIDR Block, the default route is used. (Assume that the default route exists)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.