Configure Crane Agent to Ensure Mock Service Deployed on Private Location is Reachable

If you deployed a Mock Service on a private location and it is not reachable, it could be because the IP address that is assigned to the Mock Service is not reachable.

To resolve the issue, follow these steps:

  1. Open a Terminal and use the ipconfig or ifconfig command to verify if the host has multiple network interfaces enabled.

  2. Identify an IP address that is reachable from the test client.

  3. Write down the associated interface name (for ex: eth0).

  4. Delete the existing Mock Service.

  5. Regenerate the crane agent and modify the “docker run” command to set the “PREFERRED_INTERFACE” environment variable to the identified interface name:

    --env PREFERRED_INTERFACE=eth0
  6. Recreate the Mock Service.

Now the endpoint has a reachable IP address.

Example:

docker run -d 
--env HARBOR_ID=<HARBOR_ID> --env SHIP_ID=<SHIP_ID> --env AUTH_TOKEN=<AUTH_TOKEN> --env A_ENVIRONMENT=https://a.blazemeter.net --env PREFERRED_INTERFACE=<INTERFACE_NAME> --name=<CRANE_AGENT_NAME> --restart=on-failure -v /var/run/docker.sock:/var/run/docker.sock -w /usr/src/app/ -v /tmp:/tmp --net=host blazemeter/crane python agent/agent.py

Return to agent installation steps