Traffic Capture
Physical switch SPAN, RSPAN and ERSPAN
Mirror the core switch to the HOSSIDARK capture port, with sizing rules, vendor recipes, verification and troubleshooting.
On this page
Overview
The core switch copies traffic from source ports or VLANs to a destination port connected to the HOSSIDARK capture port (or to the hypervisor uplink that carries it). HOSSIDARK only listens: the capture port never transmits, so the mirror cannot affect production traffic.
| Method | When to use | Transport |
|---|---|---|
| Local SPAN | Appliance plugged into the same switch | Copy on a local port |
| RSPAN | Appliance on another switch of the same site (layer 2) | Dedicated RSPAN VLAN |
| ERSPAN | Appliance on another site or behind a router (layer 3) | GRE (IP protocol 47) |
| Passive TAP | Loss-free copy required, or the switch has no mirror sessions left | Optical/copper splitter |
Before you start
- A dedicated capture port on HOSSIDARK, separate from the management port. Never give the capture port an IP address used for management.
- Know which links to watch. The best single source is usually the uplink between the core switch and the firewall (north–south) plus the internal server VLANs (east–west).
- Check how many mirror sessions the switch supports (often 2 to 4) and whether other tools already use them.
- Change window and access to the switch configuration.
Sizing the destination port
Mirror both directions (both, rx+tx). A full-duplex 1 Gbit/s link can carry up to 2 Gbit/s in total, so mirroring it onto a 1 Gbit/s destination drops packets when the link is busy. Rule of thumb:
| Sum of mirrored traffic (peak, both directions) | Destination port |
|---|---|
| Up to ~800 Mbit/s | 1 Gbit/s |
| Up to ~8 Gbit/s | 10 Gbit/s |
| More | Several sessions/ports, or a TAP + packet broker |
Avoid mirroring the same traffic twice (for example a VLAN and the trunk that carries it): duplicates waste bandwidth and inflate counters.
Local SPAN
Cisco IOS / IOS-XE (Catalyst)
configure terminal
monitor session 1 source interface Te1/1/1 both ! uplink to firewall
monitor session 1 source vlan 10,20,30,40 both ! internal VLANs
monitor session 1 destination interface Gi1/0/48 ! to HOSSIDARK capture
end
show monitor session 1
To keep 802.1Q tags (useful to see VLAN numbers in HOSSIDARK), add encapsulation replicate to the destination line where the platform supports it.
Cisco NX-OS (Nexus)
interface Ethernet1/48
switchport monitor
monitor session 1
source interface Ethernet1/49 both
source vlan 10,20 both
destination interface Ethernet1/48
no shut
show monitor session 1
HPE Aruba (AOS-CX)
mirror session 1
source interface 1/1/49 both
source vlan 10,20,30,40 both
destination interface 1/1/48
enable
show mirror 1
Juniper (EX / QFX)
set forwarding-options analyzer HD input ingress interface xe-0/0/49.0
set forwarding-options analyzer HD input egress interface xe-0/0/49.0
set forwarding-options analyzer HD output interface ge-0/0/47.0
commit
show forwarding-options analyzer
FortiSwitch
config switch mirror
edit "hossidark"
set dst "port48"
set src-ingress "port49"
set src-egress "port49"
set status active
next
end
On FortiSwitches managed by a FortiGate, create the equivalent mirror from the FortiGate switch-controller configuration; check the command reference of your FortiOS version.
RSPAN (another switch, same site)
Carry the copy over a dedicated RSPAN VLAN from the core to the access switch where HOSSIDARK is connected. Example on Cisco IOS with VLAN 999:
! On every switch on the path
vlan 999
remote-span
! Source switch
monitor session 1 source interface Te1/1/1 both
monitor session 1 destination remote vlan 999
! Switch where HOSSIDARK is connected
monitor session 1 source remote vlan 999
monitor session 1 destination interface Gi1/0/48
Allow VLAN 999 on the trunks between the switches and never put user ports in it.
ERSPAN (another site or routed path)
The switch wraps the copy in GRE and sends it to an address on the appliance. On HOSSIDARK, accept only that switch as a source:
hossidark-netctl tunnel-up erspan <switch-source-ip>
The appliance remembers the tunnel and recreates it at every restart; hossidark-netctl tunnel-down erspan removes it for good. The sensor unwraps GRE/ERSPAN automatically. Allow GRE (IP protocol 47) from the switch to the appliance in any firewall in between, and keep the encapsulated size under the path MTU (or allow fragmentation) so large frames are not lost.
Cisco IOS-XE source example:
monitor session 1 type erspan-source
source interface Te1/1/1 both
destination
erspan-id 10
ip address <hossidark-capture-ip>
origin ip address <switch-source-ip>
no shutdown
More detail: GRE, ERSPAN, VXLAN and flows.
Passive TAP
A TAP copies each direction of a link onto its own output. Connect both outputs to two HOSSIDARK capture ports (or to a packet broker that aggregates them). TAPs never drop under switch load and are invisible to the network, which makes them the preferred choice for the firewall uplink in high-assurance sites.
Verify
- On the switch, check the session is up and counters increase (
show monitor session,show mirror,show forwarding-options analyzer). - In the console, open Network Settings > Sensing: the capture interface should show packets and bytes increasing.
- In the SSH terminal, the diagnostics menu shows the capture counters and drops.
- Generate known traffic (for example browse a site from a workstation in a mirrored VLAN) and confirm the host appears in the asset inventory within a few minutes.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| No packets at all | Wrong destination port, session shut, cable on management port | Check show monitor session, cabling and interface link light |
| Only one direction visible | Source set to rx or tx only | Use both / ingress + egress |
| Drops at peak hours | Destination slower than the mirrored sum | 10 Gbit/s destination, fewer sources, or TAP |
| Hosts counted twice | Same traffic mirrored on VLAN and trunk | Keep one source per path |
| ERSPAN not arriving | GRE blocked or source IP not accepted | Allow IP protocol 47; re-run tunnel-up erspan with the real source IP |
| No VLAN numbers | Switch strips tags | Enable tag replication if supported |
Commands above follow each vendor's public documentation; syntax can vary between software versions, so confirm against your switch release.