Example for Configuring Local 1:1 Port Mirroring
Networking Requirements
In Figure 8-7, the administrative department of a company communicates with the Internet through the switch, and the server (monitoring device) is directly connected to the switch.
The server is required to monitor Internet-bound traffic from the administrative department.
Configuration Roadmap
- Configure GE1/0/2 as the local observing port to forward mirrored packets to the server.
- Configure GE1/0/1 as the mirrored port to copy Internet-bound traffic from the administrative department and send the traffic to the local observing port.
Procedure
- Configure an observing port.
# Configure GE1/0/2 of the switch as a local observing port.
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] observe-port 1 interface gigabitethernet 1/0/2
# Disable the observing port from forwarding data packets. This configuration is optional and recommended, so that it forwards only mirrored packets.
[Switch] observe-port 1 forwarding disable
- Configure a mirrored port.
# Configure GE1/0/1 on the switch as the mirrored port and configure GE1/0/1 to copy received packets to the local observing port.
[Switch] interface gigabitethernet 1/0/1 [Switch-GigabitEthernet1/0/1] port-mirroring to observe-port 1 inbound [Switch-GigabitEthernet1/0/1] return
- Verify the configuration.
# Verify the configuration of the observing port.
<Switch> display observe-port ---------------------------------------------------------------------- Index : 1 Untag-packet : No Forwarding : No Interface : GigabitEthernet1/0/2 ----------------------------------------------------------------------
# Verify the configuration of the mirrored port.
<Switch> display port-mirroring ---------------------------------------------------------------------- Observe-port 1 : GigabitEthernet1/0/2 ---------------------------------------------------------------------- Port-mirror: ---------------------------------------------------------------------- Mirror-port Direction Observe-port ---------------------------------------------------------------------- 1 GigabitEthernet1/0/1 Inbound Observe-port 1 ----------------------------------------------------------------------