Example for Configuring Local N:1 Port Mirroring
Networking Requirements
In Figure 8-10, three departments (science and technology departments 1 and 2 and administrative department) of a company access the Internet through the switch. The monitoring device (Server) is directly connected to the switch.
Internet-bound traffic from the three departments needs to be monitored by the server.
Configuration Roadmap
- Configure GE1/0/4 of the Switch as a local observing port to forward mirrored packets to the Server.
- Configure GE1/0/1 through GE1/0/3 of the Switch as mirrored ports to copy Internet-bound traffic from the three departments and send the traffic to the local observing port.
Procedure
- Configure an observing port.
# Configure GE1/0/4 of the Switch as a local observing port.
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] observe-port 1 interface gigabitethernet 1/0/4
# 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 mirrored ports.
# Configure GE1/0/1 through GE1/0/3 of the Switch as mirrored ports to copy the packets received by the mirrored ports and send them 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] quit [Switch] interface gigabitethernet 1/0/2 [Switch-GigabitEthernet1/0/2] port-mirroring to observe-port 1 inbound [Switch-GigabitEthernet1/0/2] quit [Switch] interface gigabitethernet 1/0/3 [Switch-GigabitEthernet1/0/3] port-mirroring to observe-port 1 inbound [Switch-GigabitEthernet1/0/3] return
- Verify the configuration.
# Check the observing port configuration.
<Switch> display observe-port ---------------------------------------------------------------------- Index : 1 Untag-packet : No Forwarding : No Interface : GigabitEthernet1/0/4 ----------------------------------------------------------------------
# Check the mirrored port configuration.
<Switch> display port-mirroring ---------------------------------------------------------------------- Observe-port 1 : GigabitEthernet1/0/4 ---------------------------------------------------------------------- Port-mirror: ---------------------------------------------------------------------- Mirror-port Direction Observe-port ---------------------------------------------------------------------- 1 GigabitEthernet1/0/1 Inbound Observe-port 1 2 GigabitEthernet1/0/2 Inbound Observe-port 1 3 GigabitEthernet1/0/3 Inbound Observe-port 1 ----------------------------------------------------------------------