How does the ACL filter the odd IP address

77 0 2 0

Few days ago, one guy asked me could the ACL filter the specifc addresses, such as 10.1.1.1, 10.1.1.3, 10.1.1.5. As many of us would create three rules to match these three IPs, but actually, we could do that task with one rule.

In this post, we are gonna to introduce the special filter methods with ACL.

First of all, let’s take a look at the structure of the rule

191111bg6ou6amioldutxi.jpg

As we know, it is the wildcard of source field which decides the part of source IP address to be matched, 0 in the wildcard of source indicates the corresponding bit in the source IP should match, while 1 indicates the corresponding bit might not match.

Commonly, we create the rules with wildcard structure as 0.0.0.255, but actually, we can modify the wildcard to match some special requests.

For example, if we want to pick out the IP address ended with odd number, such as 10.1.1.1, 10.1.1.3, 10.1.1.5……, 10.1.1.2n+1, we can set wildcard as 0.0.0.254.

How does it work? Let’s take a look at the analyzation below:

191111lp6c4icsazlpousc.png

As the picture above displayed, when the wildcard is 0.0.0.254, the first seven bits of the last eight bits may not match, and the last bit should match. In this situation, the last number of the source IP address will be the odd number.

Let’s do an example, the topology is as below:

191111orvjrsrrgg5gm9m7.png


when we want to allow PC2 and PC4 can access the router while PC1 and PC3 not. The ACL should be as below:


191111nv0zm1fpm6clsc40.png


the test result verified our idea.

PC4:


191111abh329y8yqv3mivb.png

 

PC3:

191112ktjjpp55tb5tatpz.png

 

On the other hand, if the PC1 and PC3 are allowed while PC2 and PC4 not, the ACL should be modified as below:


191112zpeh8ppu1burulr8.png


And the result is just as we predicted.

PC4:

191112n7f91g1psjfzqu9p.png

 

PC3:

191112wnutsudqnsgw3y55.png

 

 

Actually, more rules could be created to match other special requests. We talked about only in two scenarios, if you guys have any interesting ideas, please feel free to share it out.

That’s all for this post. Hope you like it, if you have other comments, feel free to post it out. And you can find more on our support website (click HERE) and knowledge base (click HERE).

 

 


  • x
  • convention:

Comment

Reply
You need to log in to reply to the post Login | Register

Notice Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."
If the attachment button is not available, update the Adobe Flash Player to the latest version!
Login and enjoy all the member benefits

Login and enjoy all the member benefits

Login