此示例显示逻辑“或”
R1#show ip int br
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES TFTP administratively down down
Ethernet0/1 192.168.56.11 YES TFTP up up
Ethernet0/2 unassigned YES TFTP administratively down down
Ethernet0/3 unassigned YES TFTP administratively down down
R1#
R1#show ip int br | inc Ethernet0/0|192.168.56.11
Ethernet0/0 unassigned YES TFTP administratively down down
Ethernet0/1 192.168.56.11 YES TFTP up up
R1#
另一个例子通过使用正则表达式使用逻辑“AND”:
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
192.168.56.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.56.0/24 is directly connected, Ethernet0/1
L 192.168.56.11/32 is directly connected, Ethernet0/1
R1#
R1#
R1#show ip route | inc C.*directly connected
C 192.168.56.0/24 is directly connected, Ethernet0/1
R1#
- “。”表示任何单个字符
- “*”表示前面字符的零个或多个实例
- 所以管道基本上转换为“C”,然后是任何字符(空格/文本),然后是“直接连接”
希望对你有帮助