To meter the products in an isolated network, you can add and configure a second network adapter for the vCloud Usage Meter appliance.

During the deployment of the vCloud Usage Meter appliance, you configure the settings of the primary network adapter. You can then add a second network adapter, and configure it manually or by running a script. The second network adapter can support both DHCP or static IP allocation.

Add a Second Network Adapter in vCloud Usage Meter

After successfully deploying vCloud Usage Meter, you can add a second network adapter.

Procedure

  1. Log in to vSphere Client as the user that deployed the vCloud Usage Meter appliance.
  2. Navigate to the vCloud Usage Meter appliance.
  3. Right-click the vCloud Usage Meter appliance and select Edit Settings from the drop-down menu.
    The Edit Settings window opens.
  4. Navigate to Add new device > Network Adapter.
  5. Configure the network adapter.
    1. Select the network.
    2. Select the adapter type and the MAC address.
    3. Verify that the Connected check box is checked.

Configure a Second Network Adapter for vCloud Usage Meter Manually

After you add a new network adapter for the deployed vCloud Usage Meter appliance, you can configure the network adapter manually.

Procedure

  1. Create and configure a .network file inside /etc/systemd/network/ that contains the settings for the new network adapter.
    Note: Consider the following factors:
    • Ensure that the name of the new network interface does not match the name of any of the existing adapters.
    • The permissions for the .network file must be 644. Check the permissions with the chmod command.
  2. Restart the systemd-networkd and daemon-reload services.
    systemctl daemon-reload
    systemctl restart systemd-networkd 

Configure the Second Network Adapter for vCloud Usage Meter by Using a Script

After you add a new network adapter for the deployed vCloud Usage Meter appliance, you can configure the second network adapter by using a script.

You can use the configure_additional_nic.sh script that is part of the vCloud Usage Meter deliverables. The script can operate with both static and DHCP IP addresses.

Procedure

  1. Transfer the script to the vCloud Usage Meter appliance using SSH (SCP).
  2. Log in to the vCloud Usage Meter Web console or the vCloud Usage Meter remote Web console as root.
  3. Run the configure_additional_nic.sh script.
    For more information about the script, run the following command.
    --h
    After the script finishes execution, a new .network file is created at /etc/systemd/network. The file contains the network settings for the new network adapter.

Configure Static Routing Tables for vCloud Usage Meter

If you have a second network adapter for vCloud Usage Meter, you can configure static routing tables and route the network packets through a specific gateway.

You can configure the network interfaces and routing with the systemd-networkd service used by Photon OS v4.

Prerequisites

Ensure that you sucessfully configured a second network adapter either manually or by script. To set up the routing tables, you must use the .network files of the network interfaces you want to configure.

Procedure

  1. To route the network packets through a specific gateway, you can configure static routes by adding a Route section in the created .network files created for the network adapter. Here are some of the attributes you can configure.
    Attribute Description
    Destination Enter the specific IP address or the whole subnet of the target network.
    Gateway Enter the IP address of the specific gateway is configured to route the traffic.
    Note: The gateway attribute might already be populated in the Network section. Make sure to remove the attribute from the Network section and place the attribute in the Route section.
    Metric Enter a lower value to prioritize the route or a higher value to deprioritize the route.
  2. To apply the changes, reload the systemd-networkd service.
    systemctl daemon-reload
    systemctl restart systemd-networkd 
  3. Verify that the static route has been added successfully by running the following command.
    ip route
    The static route appears as an ouput of the command.