Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

IP Management - Specification of Add. Range

Hello,

I have a scenario where I have to specify a contiguous range of addresses in an ACL, using the least amount of entries possible. Problem is, that these addresses do not fall on any classful boundaries, makingi t hard for me to specify a valid address and wildcard mask to choose just the particular range I want. For example, I need to make permit statements for addresses 192.168.0.5 - 192.168.0.45, and deny statements for any other addresses on the 192.168.0.0/24 network. I KNOW I'm missing something incredibly simple here...Could someone hint at how I'd best approach this without making a pile of entries in the ACL?

By the way...this is being done for PBR based on source-address, in case you're wondering.

Thank you.

2 REPLIES
Hall of Fame Super Silver

Re: IP Management - Specification of Add. Range

Would it be feasible in your environment to assign the source hosts to a given VLAN and then use VACLs to restrict the traffic?

http://www.cisco.com/en/US/partner/products/hw/switches/ps708/products_configuration_guide_chapter09186a0080160a7e.html

Hope this helps, please rate helpful posts.

New Member

Re: IP Management - Specification of Add. Range

I think this will work. I don't think it can be done with just one or two ACL entries, but I am not the best at subnet math.

In reality you don't need the deny statements at the end as every access list has an implicit deny at the end. You could consider putting the denies at the top. This way you deny early. Where the denies are placed is really determined by what the majority of your traffic will be. If most of the traffic is in the allow range it might be best to put the allows first. If most of the traffic is in the deny range it might be best to put the denies first.

access-list 111 permit ip host 192.168.0.5 any

access-list 111 permit ip host 192.168.0.6 any

access-list 111 permit ip host 192.168.0.7 any

access-list 111 permit ip 192.168.0.8 0.0.0.7 any

access-list 111 permit ip 192.168.0.16 0.0.0.15 any

access-list 111 permit ip 192.168.0.32 0.0.0.7 any

access-list 111 permit ip 192.168.0.40 0.0.0.3 any

access-list 111 permit ip host 192.168.0.44 any

access-list 111 permit ip host 192.168.0.45 any

access-list 111 deny ip 192.168.0.0 0.0.0.3 any

access-list 111 deny ip host 192.168.0.4 any

access-list 111 deny ip host 192.168.0.46 any

access-list 111 deny ip host 192.168.0.47 any

access-list 111 deny ip 192.168.0.48 0.0.0.15 any

access-list 111 deny ip 192.168.0.64 0.0.0.63 any

access-list 111 deny ip 192.168.0.128 0.0.0.127 any

141
Views
0
Helpful
2
Replies
CreatePlease login to create content