---
title: "set traffic_capture"
canonical: "https://docs.infoblox.com/space/nios86/35757273/set%20traffic_capture"
format: markdown
---
The `set traffic_capture` command allows you to capture the traffic for one or all of the ports on a NIOS appliance and save the traffic capture in a file. To capture traffic, the NIOS appliance must have a minimum of 500 MB of free disk space; otherwise, the traffic capture might fail.  
The NIOS appliance saves all traffic it captures in a .cap file and compresses it into a .tar.gz file. The size of the .cap file is limited to 4 GB for Infoblox-4030-10GE and the size is limited to 1 GB for all other NIOS appliances. In Grid Manager, you can download the traffic capture file after the traffic capture stops by navigating to the **Grid** tab -> **Grid** **Manager** tab -> **Members** tab -> and click **Traffic** **Capture** from the Toolbar. To view information about the traffic capture running on the member, see *<span style="color: #0000ff">[show](https://infoblox-docs.atlassian.net/wiki/spaces/nios86/pages/35822092)</span>*[ ](https://infoblox-docs.atlassian.net/wiki/spaces/nios86/pages/35822092)*<span style="color: #0000ff">[traffic_capture_status](https://infoblox-docs.atlassian.net/wiki/spaces/nios86/pages/35822092)</span>*.  
You can also transfer the traffic capture file to remote hosts either using FTP or SCP. You cannot transfer the traffic capture files when the traffic capture is in progress. Note that this operation may take a long time to complete.

# Syntax

`set traffic_capture on [port <all|lan1|lan2|mgmt|ha>] [vlan <id>] [duration <seconds>]`  
`[filter 'valid-tcpdump-filter-expression'] [with-rolling]`  
`set traffic_capture off`  
`set traffic_capture transfer [ftp|scp] <server-ip> <user-name> <user-password>`  
`[dest <file_name>]`

| **Argument** | **Description** |
| --- | --- |
| `on`` ` | Starts the traffic capture. |
| `off`` ` | Stops the traffic capture after you have started it. |
| `port`<br>`  all`  
`  lan1`  
`  lan2`  
`  mgmt`  
`  ha`` ` | Specifies the port for which you want to capture the traffic:<br>- Captures traffic on all ports.
- Captures traffic on the LAN1 port.
- Captures traffic on the LAN2 port.
- Captures traffic on the MGMT port.
- Captures traffic on the HA port.<br>The default is LAN1. Note that if you have enabled the LAN2 failoverfeature, the LAN1 and LAN2 ports generate the same output. (For  
information about the LAN2 failover feature, see the *About Port Redundancy *section in the *Infoblox NIOS Administrator Guide*.) |
| `vlan <id>`` ` | Captures traffic for the vLAN interface on LAN1 or LAN2 |
| `duration <seconds>`` ` | Specifies the duration in seconds for which you want the traffic capture to run. The default is 1800 seconds. |
| `filter`  
`'valid-tcpdump-filter-expression'`` ` | Allows you to set the “tcpdump” filter for traffic capture. |
| `with-rolling`` ` | Enables rolling of traffic capture file. When the traffic capture file reaches the maximum size limit, the appliance automatically saves the file into a new file and continues capturing the traffic. The appliance can save up to 4 traffic capture files. |
| `transfer`` ` | Allows you to transfer the traffic capture file to an FTP server or a SCP server. |
| `ftp`` ` | Transfers the traffic capture file to an FTP server. |
| `scp`` ` | Transfers the traffic capture file to an SCP server. |

# Example

## Start the traffic capture

`Infoblox > ``set`` ``traffic_capture`` ``on`  
` Traffic capture started successfully.`

## Stop the traffic capture

`Infoblox > ``set`` ``traffic_capture`` ``off`  
` Traffic capture stopped successfully.`

## Start the traffic capture on a specific port

`Infoblox > ``set`` ``traffic_capture`` ``on`` ``port`` ``lan1`  
` Traffic capture started successfully.`

## Specify the traffic capture filter

`Infoblox > ``set`` ``traffic_capture`` ``on`` ``port`` ``lan1`` ``filter`` ``'host`` ``10.32.2.34'`  
` Traffic capture started successfully. `  
` Infoblox > ``set`` ``traffic_capture`` ``on`` ``port`` ``lan1`` ``filter`` ``'net`` ``192.168.0.0/24'`  
` Traffic capture started successfully. `  
` For information about valid tcpdump filter expressions, refer to `<span style="color: #0000ff">[*https://wiki.wireshark.org/CaptureFilters*](https://wiki.wireshark.org/CaptureFilters)</span>`.`

## Transfer traffic capture file to an FTP server

`Infoblox > set traffic_capture transfer ftp 10.120.20.239 frtest Infoblox123 dest`  
` /home/rpadasalagi/ftp_back.tar.gz`  
` WARNING: This operation may take a long time to complete `  
`Do you want to proceed? (y or n):y`

## Transfer traffic capture file to an SCP server

`set traffic_capture transfer scp 10.120.20.239 frtest - dest /home/test/scp_back.tar.gz `  
`Enter password:`  
` WARNING: This operation may take a long time to complete `  
`Do you want to proceed? (y or n):y `

---

<span style="color: #ff0000">WARNING:</span> <span style="color: #ff0000">When</span> <span style="color: #ff0000">you</span> <span style="color: #ff0000">use</span> <span style="color: #ff0000">the</span> `set`` ``traffic_capture`` ``transfer` <span style="color: #ff0000">command,</span> <span style="color: #ff0000">the</span> <span style="color: #ff0000">user</span> <span style="color: #ff0000">password</span> <span style="color: #ff0000">is</span> <span style="color: #ff0000">logged</span> <span style="color: #ff0000">in</span> <span style="color: #ff0000">the</span> <span style="color: #ff0000">history.</span> <span style="color: #ff0000">In</span> <span style="color: #ff0000">order</span> <span style="color: #ff0000">to</span> <span style="color: #ff0000">avoid</span> <span style="color: #ff0000">exposure</span> <span style="color: #ff0000">of</span> <span style="color: #ff0000">the</span> <span style="color: #ff0000">user</span> <span style="color: #ff0000">password,</span> <span style="color: #ff0000">you</span> <span style="color: #ff0000">can</span> <span style="color: #ff0000">enter</span> <span style="color: #ff0000">dash (-)</span> <span style="color: #ff0000">instead</span> <span style="color: #ff0000">of</span> <span style="color: #ff0000">the</span> <span style="color: #ff0000">actual</span> <span style="color: #ff0000">password</span> <span style="color: #ff0000">in</span> <span style="color: #ff0000">the</span> `<user-password>` <span style="color: #ff0000">field.</span> <span style="color: #ff0000">You</span> <span style="color: #ff0000">can</span> <span style="color: #ff0000">enter</span> <span style="color: #ff0000">the</span> <span style="color: #ff0000">password</span> <span style="color: #ff0000">when</span> <span style="color: #ff0000">the</span> <span style="color: #ff0000">appliance</span> <span style="color: #ff0000">prompts</span> <span style="color: #ff0000">for</span> <span style="color: #ff0000">the</span> <span style="color: #ff0000">password.</span>

---