大网数据广告活动
服务器运维问答

On Cisco firewall, show access-list main rules only (with line numbers)

· 52CE 我爱测

For example, if I do a sh access-list Lets say I have a rule on line 2 that has one object-group to another object-group connected on X ports. Well, there may be 30 lines below that, that all say line 2 and shows the specific det…

问题原文

原帖链接 · Patrick · CC BY-SA 3.0

For example, if I do a sh access-list

Lets say I have a rule on line 2 that has one object-group to another object-group connected on X ports. Well, there may be 30 lines below that, that all say line 2 and shows the specific details of each individual ip from the first group to the second group.

How do I only show that first main rule and is this even possible? The first one with the group info only, not the drilled down detailed info. I want to do this for the whole access list however. Basically... show me all the main rules in an access-list with line numbers. This would make it easier to find rules to remove or add remarks to.

Any help would be much appreciated! Hopefully I explained it well.

access-list INNERin line 2 extended permit tcp object-group Group1 object-group Group2 object-group Group-Ports-TCP

access-list INNERin line2 extended permit tcp 192.168.1.1 255.255.255.0 192.168.2.1 255.255.255.0 eq 443

access-list INNERin line2 extended permit tcp 192.168.1.1 255.255.255.0 192.168.2.1 255.255.255.0 eq 80

access-list INNERin line2 extended permit tcp 192.168.3.1 255.255.255.0 192.168.2.1 255.255.255.0 eq 443

access-list INNERin line2 extended permit tcp 192.168.3.1 255.255.255.0 192.168.2.1 255.255.255.0 eq 80

etc

已采纳解答

原帖链接 · Stephen Gun · CC BY-SA 4.0

show access-list INNERin | exclude ^[ ]

Exclude lines which start with a space.

The square brackets are not really necessary, as long as you have a space after the "^". You can also abbreviate "exclude" as "e".

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-05-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。