Configure Packet Mirroring
You must complete the following tasks to create packet mirroring in GCP.
Task 1 - Create Instance Group
Task 2 - Create Packet Mirroring Policy
Task 4 - Verify Packet Mirroring in GCP
Task 1 - Create Instance GroupTask 1 - Create Instance Group
Complete the following steps to create the Instance group:
-
In the Google Cloud Console, go to the Instance groups page.
-
Click Create Instance Group.
-
Click New Unmanaged Instance Group from the left panel.
-
Fill in the details to configure the unmanaged instance group:
-
Name: Enter a name for the unmanaged instance group.
-
Description: Enter the description for instance group.
-
Under Location: Select a region from the Region drop-down list and select a zone from the Zone drop-down list.
-
Network: Select a network from the drop-down list.
-
Subnetwork: Select a subnetwork from the drop-down list.
-
VM Instance: Select the required decoder from the Select VMs drop-down list. The mirrored traffic will be sent to this VM instance.
-
Port Mapping: By default, the port is selected.
-
-
Click Create.
Task 2 - Create Packet Mirroring PolicyTask 2 - Create Packet Mirroring Policy
In the following procedure, Mirrored source and destination VM instances are in the same VPC network or subnetwork. You can also set both Mirrored source and destination VM instances on a different VPC network or subnetwork. For more information, see https://cloud.google.com/vpc/docs/using-packet-mirroring.
Complete the following steps to Create Packet Mirroring Policy.
-
In the Google Cloud console, go to the Packet Mirroring page.
-
Click Create Policy.
-
Under Define policy overview, enter the following details:
-
Name: Enter a name for the policy.
-
Region: Select the region from the drop-down list.
-
Under Policy enforcement, select Enabled and click Continue.
-
-
Under Select VPC network, select Mirrored source and collector destination are in the same VPC network.
-
Select the required network from the Network drop-down list.
-
Click Continue.
-
-
Under Select mirrored source, select Select individual instances.
Select the required instances from the Instance selection table and click Continue.
Note: All traffic will be mirrored from this instance.
-
Under Select collector destination, click create new L4 internal load balancer and follow Task 3 - Create Load Balancer to complete configuration of load balancer.
-
Once the load balancer is created, click Refresh in the Collector destination drop-down menu.
-
Select the newly created load balancer and Continue.
-
Do one of the following:
-
Select either both ingress (incoming) and egress (outgoing) traffic to be mirrored from the source VM instance by enabling Mirror all traffic (default) which is same as Allow both ingress and egress traffic under Traffic direction.
-
Select Mirror filtered traffic and select Allow egress traffic only to mirror only the outgoing traffic from the source VM instance and send them to decoder.
-
Select Mirror filtered traffic and select Allow ingress traffic only to mirror only the incoming traffic from from the source VM instance you want and send them to decoder.
-
-
Click Submit. The policy will be created successfully.
Task 3 - Create Load BalancerTask 3 - Create Load Balancer
Complete the following steps to create the Load Balance:
-
Click Load balancing.
-
Click + Create Load Balancers.
-
Enter the following details to configure load balancer:
-
Name: Enter a name for the load balancer.
-
Region: Select a region from the drop-down list.
-
Network: Select a network from the drop-down list.
-
-
Click Backend configuration.
-
Under New backend, select the instance group created in Task 1 - Create Instance Group from the Instance group drop-down list.
-
Perform the following steps to create a Health Check:
-
Name: Enter a name for the health check.
-
(Optional) Description: Enter the description for the health check.
-
Under Scope: By default, Regional option is selected.
-
Region: Select the region from the drop-down list.
-
Protocol: Select the TCP protocol from the drop-down list.
-
Port: Enter the port number 80.
-
Proxy Protocol: By default, None option is selected.
-
Logs: By default, Off option is selected.
-
Under Health Criteria, retain the default values.
-
Click Save.
-
-
Click Frontend Configuration.
-
Under New Frontend IP and port, configure the following details:
-
(Optional) Name: Enter a name.
-
Description: Provide the description.
-
Under Protocol, in the TCP section, select a subnetwork from the drop down list.
-
Under Internal IP, in the Purpose section, by default Non-shared is selected.
-
IP address: By default, Epherneral (Automatic) is selected.
-
Under Ports, select All option.
-
Under Global Access, by default Disable is selected.
-
Under Packet Mirroring, select Enable this load balancer for Packet Mirroring.
-
(Optional) Under Review and Finalize, review all the configured details.
-
Click Create.
-
-
The Load Balancer will be created. The Health Check may show unhealthy status but it does not impact packet mirroring policy.
Task 4 - Verify Packet Mirroring in GCPTask 4 - Verify Packet Mirroring in GCP
- Go to the Packet Decoder service and click > View > Config page and set the Capture Interface Selected parameter to the following value:
packet_mmap_eth0(bpf)
-
SSH to the source mirrored instance.
-
Run the following command curl <yahoo.com> on source mirrored instance.
-
SSH to the Packet Decoder.
-
Run the following command tcpdump on Packet Decoder and verify if the traffic has been mirrored.
-
Log in to the NetWitness Platform to verify on Packet Decoder.
-
Go to Investigate > Events and select Concentrator from query profile drop-down menu.
-
To verify, click search will filter out the domains name based on their configuration.