juniper交换机配置端口镜像,端口配置报错。

问题遇到的现象和发生背景

juniper交换机上配置端口镜像,然后出现如下报错提示:

运行结果及报错内容

[edit forwarding-options analyzer ip_guard input ingress interface]
'xe-0/0/47.0'
interface must not be output of any other analyzer session
[edit forwarding-options analyzer ip_guard input egress interface]
'xe-0/0/47.0'
interface must not be output of any other analyzer session
[edit forwarding-options analyzer ip_guard output interface]
'interface xe-0/0/47.0'
An interface configured as family inet cannot be configured as analyzer output interface
[edit forwarding-options analyzer port-moniter output interface]
'interface xe-0/0/47.0'
An interface configured as family inet cannot be configured as analyzer output interface
[edit firewall filter port-mirror term 1 then]
'port-mirror'
Configure 'port-mirroring' under 'forwarding-options'
error: commit failed: (statements constraint check failed)

我的解答思路和尝试过的方法

一开始说要配在47口,结果配置以后才发现47口已被占用,我使用了delete,但是没有命令没有被清除掉。

我想要达到的结果

juniper的命令行配置,可以不保存吗?这个错误要怎么消除呢?

可以不保存 ,应该是配置错了,下面是举例配置步骤

操作步骤:
(1)建立一个端口镜像名称,并且指定需要作镜像的端口,同一个镜像名称可以指定多个要镜像的端口的。
(2)创建镜像名称之后,指定需要镜像的输出端口,然后在输出端口接个sniffer就可以抓取镜像的流量了。
 
#"编辑镜像名称参数,port_monitor是镜像名称,如果不存在就创建一个新的"
[edit]
lab@EX4200-1# editethernet-switching-options analyzer port_monitor
[editethernet-switching-options analyzer port_monitor]
lab@EX4200-1# set inputegress interface ge-0/0/10.0  #"定义要镜像端口输出流量"   
lab@EX4200-1# set inputingress interface ge-0/0/10.0  #"定义要镜像端口输入流量"
lab@EX4200-1# set outputinterface ge-0/0/1.0     #"定义输出端口(接sniffer的端口)"
lab@EX4200-1#

也可以定义基于fireware的端口镜像。
#设置镜像输出端口
lab@EX4200-1# top  
[edit]
lab@EX4200-1#set ethernet-switching-options analyzer port_monitor output interfacege-0/0/10.0
 
#"设置过滤条件,具体条件设置请参考JUNOS的filter设置说明"
lab@EX4200-1#edit firewall family ethernet-switching filter mirror_filter     # “ mirror_filter为policy名称"             
 
[edit firewall familyethernet-switching filter mirror_filter]
lab@EX4200-1#
lab@EX4200-1#set   term 1 from destination-address 192.0.2.16/28  #"第一个条目term 1目的IP地址"
lab@EX4200-1#set  term 1 fromsource-address 192.0.2.16/28  #"指定源IP地址"
lab@EX4200-1#set  term 1 fromdestination-port 80 #"指定目的端口"
 
#"定义符合条件进行镜像动作,port_monitor就是上面定义的镜像名称"
lab@EX4200-1#set  term 1 then analyzer port_monitor
 
lab@EX4200-1#set  term 2 then accept  #"生成第二条term条目,指定其它流量不镜像"
 
 
#设置需要镜像端口的filter参数
lab@EX4200-1# top
lab@EX4200-1# delete interfacesge-0/0/1 unit 0
lab@EX4200-1# setinterfaces ge-0/0/1 unit 0 family ethernet-switching
lab@EX4200-1#set interfaces   ge-0/0/0 unit 0 family ethernet-switchingfilter input mirror_filter 

操作步骤:
(1)建立一个端口镜像名称,并且指定需要作镜像的端口,同一个镜像名称可以指定多个要镜像的端口的。
(2)创建镜像名称之后,指定需要镜像的输出端口,然后在输出端口接个sniffer就可以抓取镜像的流量了。

你可以回滚下:


root@SRX1#rollback ?
Possible completions:
<[Enter]> Execute this command
0 2022-07-04 06:34:34 UTC by root via cli
1 2022-07-04 05:48:28 UTC by root via cli
2 2022-07-04 03:37:11 UTC by root via cli
3 2022-07-04 03:32:07 UTC by root via cli
4 2022-07-04 03:29:17 UTC by root via cli
5 2022-07-04 03:27:59 UTC by root via cli
6 2022-07-04 03:25:04 UTC by root via cli
7 2022-07-04 02:56:05 UTC by root via other