포트 미러링은 다른 포트에서 특정 포트의 패킷을 모니터링합니다. 다음 예에서는 포트 25의 모든 수신 패킷을 포트 26으로 미러링하는 방법을 보여줍니다.
이 작업에 대한 토폴로지는 Basic SEFOS Topology를 참조하십시오. SEFOS-1 스위치에서 다음 명령을 입력하십시오.
Connect to SEFOS을 참조하십시오.
SEFOS-1# configure terminal SEFOS-1(config)# interface vlan 1 SEFOS-1(config-if)# shutdown SEFOS-1(config-if)# ip address 12.0.0.1 255.0.0.0 SEFOS-1(config-if)# no shutdown SEFOS-1(config-if)# end
SEFOS-1# ping 12.0.0.100 Reply Received From :12.0.0.100, TimeTaken : 60 msecs Reply Received From :12.0.0.100, TimeTaken : 100 msecs Reply Received From :12.0.0.100, TimeTaken : 90 msecs --- 12.0.0.100 Ping Statistics --- 3 Packets Transmitted, 3 Packets Received, 0% Packets Loss
호스트 A에서 스위치로 보낸 ping 응답은 포트 26에서 캡처되지 않습니다. 이때 포트 26은 포트 미러링 구성 이전에 패킷 캡처 장치에 연결되었습니다.
SEFOS-1# configure terminal
SEFOS-1(config)# monitor session destination interface xl-ethernet 0/26
SEFOS-1(config)# monitor session source interface xl-ethernet 0/25 rx
SEFOS-1(config-if)# end
SEFOS-1# show port-monitoring Port Monitoring is enabled Monitor Port : X10/26 Port Ingress-Monitoring Egress-Monitoring ---- ------------------ ----------------- X10/25 Enabled Disabled ...
SEFOS-1# ping 12.0.0.100
# tcpdump -xx -n -i eth3 icmp ... listening on eth3, link-type EN10MB (Ethernet), capture size 96 bytes 17:09:58.595583 IP 12.0.0.100 > 12.0.0.1: ICMP echo reply, id 0, seq 1, length 40 ... 0x0010: 003c 68e6 4000 ff01 fa75 0c00 0064 0c00 17:09:58.617899 IP 12.0.0.100 > 12.0.0.1: ICMP echo reply, id 0, seq 2, length 40... 0x0030: a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 a5a5 17:09:58.698280 IP 12.0.0.100 > 12.0.0.1: ICMP echo reply, id 0, seq 3, length 40...