The ACL filters out odd or even routes.

Source: Internet
Author: User


In a multi-protocol network with an odd or even number of routes, the customer Address Allocation is very fine, many of which are: www.2cto.com 192.168.1.0/24192.168.2.0/24192.168.3.0/24192.168.4.0/24192.168.5.0/24 .......................... Some networks need to filter and analyze all the network segments with even digits: Because R1 is required to be able to learn only the network numbers of odd digits or even numbers of R3. split each subnet into a binary system to observe the rule 192.168.1.0/24192.168.00000001.0/24192.168.2.0/24192.168.00000010.0/24192.168.3.0/24 192.168.4.0/latest/24192.168.5.0/latest/24192.168.6.0/latest/24192.168.7.0/24 192.168.8.0/24192.168.00001000.0/24 we can find that, if the x of 192.168.x.0/24 is an even number, the 24th bits are 0. If it is odd, the 24th bits are 1, therefore, according to this rule, the 0 of the ACL is completely matched. 1 indicates that the matching rule is ignored. The following two ACLs can be written to match the 24th bits. www.2cto.com: access-list 2 permit 192.168.1.0 0.0.254.0192.168.00000001.0000.000.111110.0 network number used for even (even) bits: access-list 1 permit 192.168.0.0 complete basic configuration Verification
Directly in R2 redistribution, R1 learned all the networks. R1 # sh ip route 1.0.0.0/32 is subnetted, 1 subnetsC 1.1.1.1 is directly connected, Loopback0 23.0.0.0/24 is subnetted, 1 subnetsO E2 23.1.1.0 [110/20] via 12.1.1.2, 00:00:05, fastEthernet0/0O E2 192.168.4.0/24 [110/20] via 12.1.1.2, 00:00:05, FastEthernet0/0 12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, fastEthernet0/0O E2 192.168.1.0/24 [110/20] via 12.1.1.2, 00:00:05, FastEt Hernet0/0O E2 192.168.2.0/24 [110/20] via 12.1.1.2, 00:00:05, FastEthernet0/0O E2 192.168.3.0/24 [110/20] via 12.1.1.2, 00:00:05, FastEthernet0/0 R2 (config) # ip access-list standard permit_oddR2 (config-std-nacl) # per 192.168.1.0 0.0.254.255 # Only odd numbers are allowed (the Anti-mask is written as 0.0.254.0) R2 (config) # route-map permit_odd per 10R2 (config-route-map) # match ip add permit_oddR2 (config-router) # redistribute rip subnets route-map pe Rmit_odd: Check the R1 route table and find that only the odd route is left. The experiment is successful. The same applies to even network segments. R1 # sh ip route 1.0.0.0/32 is subnetted, 1 subnetsC 1.1.1.1 is directly connected, Loopback0 12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, fastEthernet0/0O E2 192.168.1.0/24 [110/20] via 12.1.1.2, 00:04:24, FastEthernet0/0O E2 192.168.3.0/24 [110/20] via 12.1.1.2, 00:04:24, FastEthernet0/0

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.