Traffic mirror sessions - Amazon Virtual Private Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Traffic mirror sessions

A traffic mirror session establishes a relationship between a traffic mirror source and a traffic mirror target. For more information, see Traffic mirror session concepts.

A traffic mirror session contains the following resources:

You can create a traffic mirror session only if you are the owner of the network interface or the subnet for the traffic mirror source.

Create a traffic mirror session

To create a traffic mirror session using the console
  1. Open the Amazon VPC console at https://console.amazonaws.cn/vpc/.

  2. In the Region selector, choose the Amazon Region that you used when you created the VPCs.

  3. In the navigation pane, choose Traffic Mirroring, Mirror sessions.

  4. Choose Create traffic mirror session.

  5. (Optional) For Name tag, enter a name for the traffic mirror session.

  6. (Optional) For Description, enter a description for the traffic mirror session.

  7. For Mirror source, choose the network interface of the mirror source.

  8. For Mirror target, choose an existing traffic mirror target or choose Create target to create one. For more information, see Create a traffic mirror target.

    If the mirror target is owned by another account and shared with you, you must first accept the resource share.

  9. For Additional settings, do the following:

    1. For Session number, enter the session number. The valid values are 1 to 32,766, where 1 is the highest priority. Sessions are evaluated based on the priority indicated by this session number.

    2. (Optional) For VNI, enter the VXLAN ID to use for the traffic mirror session. For more information about the VXLAN protocol, see RFC 7348.

      If you do not enter a value, we assign a random number.

    3. (Optional) For Packet Length, enter the number of bytes in each packet to mirror.

      To mirror the entire packet, do not enter a value. To mirror only a portion of each packet, set this value to the number of bytes to mirror. For example, if you set this value to 100, the first 100 bytes after the VXLAN header that meet the filter criteria are copied to the target.

    4. For Filter, choose an existing traffic mirror filter. Alternatively, choose Create filter. For more information, see Step 2: Create the traffic mirror filter.

  10. (Optional) For each tag to add, choose Add new tag and enter the tag key and tag value.

  11. Choose Create.

To create a traffic mirror session using the Amazon CLI

Use the create-traffic-mirror-session command.

View your traffic mirror sessions

To view your traffic mirror sessions using the console
  1. Open the Amazon VPC console at https://console.amazonaws.cn/vpc/.

  2. In the navigation pane, choose Traffic Mirroring, Mirror sessions.

  3. Select the ID of the traffic mirror session to open its details page.

To view your traffic mirror session using the Amazon CLI

Use the describe-traffic-mirror-sessions command.

Modify your traffic mirror session

To modify your traffic mirror session using the console
  1. Open the Amazon VPC console at https://console.amazonaws.cn/vpc/.

  2. In the navigation pane, choose Traffic Mirroring, Mirror sessions.

  3. Select the radio button for the traffic mirror session.

  4. Choose Actions, Modify session.

  5. (Optional) For Description, enter a description for the traffic mirror session.

  6. For Mirror target, choose an existing traffic mirror target or choose Create target to create one. For more information, see Create a traffic mirror target.

  7. For Additional settings, do the following:

    1. For Session number, enter the session number. The valid values are 1 to 32,766, where 1 is the highest priority.

    2. (Optional) For VNI, enter the VXLAN ID to use for the traffic mirror session. For more information about the VXLAN protocol, see RFC 7348.

      If you do not enter a value, we assign a random unused number.

    3. (Optional) For Packet Length, enter the number of bytes in each packet to mirror.

      To mirror the entire packet, do not enter a value. To mirror only a portion of each packet, set this value to the number of bytes to mirror. For example, if you set this value to 100, the first 100 bytes after the VXLAN header that meet the filter criteria are copied to the target.

    4. For Filter, choose the traffic mirror filter that determines what traffic gets mirrored.

  8. Choose Modify.

To modify your traffic mirror session using the Amazon CLI

Use the modify-traffic-mirror-session command.

Modify traffic mirror session tags

To modify your traffic mirror session tags using the console
  1. Open the Amazon VPC console at https://console.amazonaws.cn/vpc/.

  2. In the navigation pane, choose Traffic Mirroring, Mirror sessions.

  3. Select the ID of the traffic mirror session to open its details page.

  4. On the Tags tab, choose Manage tags.

  5. (Optional) For each tag to add, choose Add new tag and enter the tag key and tag value. For each tag to remove, choose Remove.

  6. Choose Modify.

To modify your traffic mirror session using the Amazon CLI

Use the create-tags command to add a tag. Use the delete-tags command to remove a tag.

Delete a traffic mirror session

You are charged on an hourly basis for each active traffic mirror session. To stop all Traffic Mirroring charges, you must delete all active traffic mirror sessions. If you delete the network interface for the traffic mirror source, the traffic mirror sessions for the source are deleted automatically.

To delete your traffic mirror session using the console
  1. Open the Amazon VPC console at https://console.amazonaws.cn/vpc/.

  2. On the navigation pane, choose Traffic Mirroring, Mirror sessions.

  3. Select the traffic mirror session, and then choose Actions, Delete.

  4. When prompted for confirmation, enter delete, and then choose Delete.

To delete a traffic mirror session using the Amazon CLI

Use the delete-traffic-mirror-session command.