cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4483
Views
10
Helpful
5
Replies

show access-list | include

Nathan Hawkins
Level 1
Level 1

Couple questions on show with include

1. Can you do a show command with include and a space meaning can you search for say "permit ip"?

2. Can you do a search for an exclude say "show access-list | exclude eq"?                  

5 Replies 5

jocamare
Level 4
Level 4

The answer to both questions is YES.

Forgot to mention that you can also use a second pipe as a OR in your expression.

Heh - ok - I was more interested in what the examples would look like. I feel a bit silly for the second question...I guess I never paid any attention to the options after a pipe... so I see you can do a pipe exclude but how do you do the include for words and spaces?

Can you do a show command for access-list where you are looking for permit IP without "eq"?

Hi,

I dont think any "access-list" line that has "permit ip" has an "eq" as those are only used with either UDP or TCP only permit statements that have/use ports.

If on the other hand you are talking about looking for ACL lines that allow UDP or TCP without any port restrictions then this might work

ACL lines with "permit tcp" without "eq"

show access-list | exclude ip|udp|deny|eq|range

ACL lines with "permit udp" without "eq"

show access-list | exclude ip|tcp|deny|eq|range

EDIT: The above doesnt filter every possible other line from the output though, depending on your ACL configuration.

- Jouni

Sure, examples:

How do you do the include for words and spaces?

When filtering you can use the underscore to refer to spaces on the lines.

Can you do a show command for access-list where you are looking for permit IP without "eq"?

You can't mix commands like, mixing "inc" & "exc".  So no.

Besides, the only available option when using two or more pipes is only OR, in case you were wondering.

Now, examples

show run access-list test

access-list test remark hello world

access-list test remark helloworld

access-list  test remark hey hello world

access-list  test remark heyhelloworld

Now, filtering:

show runnaccess-list | i hello

access-list test remark hello world

access-list test remark helloworld

access-list test remark hey hello world

access-list test remark heyhelloworld

show run access-list | i _world

access-list test remark hello world

access-list  test remark hey hello world

show run access-list | i hey |  world

access-list test remark hello world

access-list test remark hey hello world

I think that covers it.

Here is a good articule about the topic:

http://stack.nil.com/ipcorner/EnhanceIOSUI/

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card