Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access list question

Status
Not open for further replies.

MAJBlaine

IS-IT--Management
May 20, 2002
34
0
0
US
Is there an easy way to define an access list for a string of ports without having to enumerate each one?

I want to convert these lines into one:

access-list 106 permit ip 138.18.198.0 0.0.0.255 24.22.61.0 0.0.0.255 eq 80 log
access-list 106 permit ip 138.18.198.0 0.0.0.255 24.22.61.0 0.0.0.255 eq 81 log
access-list 106 permit ip 138.18.198.0 0.0.0.255 24.22.61.0 0.0.0.255 eq 82log
access-list 106 permit ip 138.18.198.0 0.0.0.255 24.22.61.0 0.0.0.255 eq 83 log
access-list 106 permit ip 138.18.198.0 0.0.0.255 24.22.61.0 0.0.0.255 eq 84 log
access-list 106 permit ip 138.18.198.0 0.0.0.255 24.22.61.0 0.0.0.255 eq 85 log
access-list 106 permit ip 138.18.198.0 0.0.0.255 24.22.61.0 0.0.0.255 eq 86 log
access-list 106 permit ip 138.18.198.0 0.0.0.255 24.22.61.0 0.0.0.255 eq 87 log

Thanks,
Blaine
 
the less than (lt) and greater than (gt) operators are valid in extended access lists but only one per entry if I recall. So it gets tricky. Remember that the list gets read from top to bottom. So you could deny all ports less than 80 and all ports higher than 87, for example. Then permit all.

Also, when specifying ports, I think the syntax is 'permit/deny tcp' as opposed to 'permit/deny ip.'

See if that works out for you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top