Mirror port traffic with TAP-as-a-Service
Monitor network traffic by using TAP-as-a-Service port mirroring for security and compliance, performance analysis, troubleshooting, auditing, and lawful surveillance on traffic to and from ports.
TAPaaS uses the TAP mirror service, which uses OVN port mirroring capabilities. The mechanism intercepts packets and duplicates them without altering the original packet headers, ensuring that IP addresses and port information remain intact for the monitoring tool.
TAPaaS captures traffic at the VM instance TAP port. The mirrored traffic is identical to what the instance receives and sends. Traffic blocked by a security group or firewall rule is not included in the mirror.
You can use the GRE or ERSPAN protocols to tunnel TAP traffic from the source port to the destination port.
Activate TAP-as-a-Service for port mirroring Copy linkLink copied!
Enable TAP-as-a-Service in the Networking service.
Before you begin Copy linkLink copied!
- You have the oc command line tool installed on your workstation.
- You are logged on to a workstation that has access to the RHOSO control plane as a user with
cluster-adminprivileges. - A deployed OpenStackControlPlane resource in the openstack namespace.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Verify that the neutron pods reconciled without an error. Include the
-woption if you want to observe the process.$ oc get pods -l service=neutron -w -n openstackIn the following example, the neutron pods were successfully reconciled:
$ oc get pods -l service=neutron NAME READY STATUS RESTARTS AGE neutron-d44b4c69-bvckl 2/2 Running 0 74s neutron-d44b4c69-dqmhd 2/2 Running 0 110s neutron-d44b4c69-n22wc 2/2 Running 0 2m29s
Mirror traffic to a remote IP (example) Copy linkLink copied!
Mirror port traffic to a remote IP address by using ERSPAN or GRE tunneling. For example, use openstack tap mirror to mirror traffic inbound to a port on VM1.
Before you begin Copy linkLink copied!
- TAPaaS is configured and enabled.
- You have the oc command line tool installed on your workstation.
- You are logged on to a workstation that has access to the RHOSO control plane as a user with
cluster-adminprivileges. - The IDs of the target (monitoring) and source (monitored) neutron ports.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Use
sshto log in to the Compute node that hosts the source instance. - Use the
tcpdumptool to view the traffic. The following example can be used to capture GRE or ERSPANv1 mirror types, because both use GRE.Example:
$ tcpdump -i br-ex proto gre
Mirror traffic to a VM in OpenStack (example) Copy linkLink copied!
Mirror traffic between virtual machines across different networks to inspect and analyze network packets.
Before you begin Copy linkLink copied!
- TAPaaS is configured and enabled.
- You have the oc command line tool installed on your workstation.
- You are logged on to a workstation that has access to the RHOSO control plane as a user with
cluster-adminprivileges. - A deployed OpenStackControlPlane resource in the openstack namespace.
- The IDs of the target (monitoring) and source (monitored) neutron ports.
- The source and target instances are running.
About this task Copy linkLink copied!
You can specify ERSPAN or GRE tunneling. This example uses GRE.
You must create a separate TAP mirror for each mirrored port.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Log in to the destination instance.
- Run the
tcpdumptool on the destination instance to confirm receipt of mirrored packets. In this example, the tcpdump would show a more verbose output.$ tcpdump -envi eth0 proto 47