Difference between revisions of "Switch port mirroring"

From Teknologisk videncenter
Jump to: navigation, search
m (New page: Switch port mirroring is often used when sniffing traffic to/from a device. Se drawing below. {| | thumb|700px|left| Switch with port mirroring |}...)
 
m (Cisco Switch)
Line 7: Line 7:
 
Example below: Send a copy of traffic on fastethernet 0/1 to fastethernet 0/2. Traffic in both directions are mirrored.
 
Example below: Send a copy of traffic on fastethernet 0/1 to fastethernet 0/2. Traffic in both directions are mirrored.
 
<source lang=cli>
 
<source lang=cli>
SW1# <input>CONFIGURE TERMINAL</input>
+
SW1# <input>configure terminal</input>
SW1(config)# <input>MONITOR SESSION 1 SOURCE FASTETHETNET 0/1</input>  
+
SW1(config)# <input>monitor session 1 source fastethernet0/1</input>  
SW1(config)# <input>MONITOR SESSION 1 DESTINATION FASTETHERNET 0/2</input>
+
SW1(config)# <input>monitor session 1 destination fastethernet 0/2</input>
 
</source>
 
</source>
  
Line 17: Line 17:
 
SW1(config)# <input>no MONITOR SESSION 1</input>  
 
SW1(config)# <input>no MONITOR SESSION 1</input>  
 
</source>
 
</source>
 +
 
=Zyxel switch=
 
=Zyxel switch=
 
Copy traffic from port 1,4,5 and 6 to port 3
 
Copy traffic from port 1,4,5 and 6 to port 3

Revision as of 06:10, 29 September 2010

Switch port mirroring is often used when sniffing traffic to/from a device. Se drawing below.

Switch with port mirroring

Cisco Switch

Example below: Send a copy of traffic on fastethernet 0/1 to fastethernet 0/2. Traffic in both directions are mirrored.

SW1# <input>configure terminal</input>
SW1(config)# <input>monitor session 1 source fastethernet0/1</input> 
SW1(config)# <input>monitor session 1 destination fastethernet 0/2</input>

Remove mirror from session 1.

SW1# <input>CONFIGURE TERMINAL</input>
SW1(config)# <input>no MONITOR SESSION 1</input>

Zyxel switch

Copy traffic from port 1,4,5 and 6 to port 3

Switch(config)# <input>mirror-port</input>
Switch(config)# <input>mirror-port 3</input>
Switch(config)# <input>interface port-channel 1,4-6</input>
Switch(config-interface)# <input>mirror</input>
Switch(config-interface)# <input>mirror dir egress</input>

Remove mirror again

Switch(config)# <input>no mirror-port</input>