Overview
When integrating the Virtru Gateway with Microsoft 365 or Google Workspace, it’s often necessary to run multiple containers to handle distinct encryption flows (e.g., inbound vs. outbound). Since Microsoft 365 doesn’t natively support multiple connectors within a single containerized environment, the best solution is to assign unique external IP addresses and/or custom ports to each Virtru container.
This guide outlines how to assign IP addresses to multiple Virtru containers using Podman or Docker.
Note: IP addresses shown are examples. Use your actual assigned IPs. With each container bound to a unique IP, you can reuse the same port (e.g., 25) across all containers without conflict. Alternatively, you can assign unique external ports (e.g., 9001, 9002) that map to port 25 inside the container.
Important: This setup requires multiple Network Interface Cards (NICs) on your VM. Please coordinate with your network team to allocate external IPs or ports. Virtru Support can assist with updating application scripts as needed.
You can follow your cloud provider’s guide to add additional NICs:
-
GCP: https://cloud.google.com/vpc/docs/configure-routing-additional-interface
-
AWS: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-network-interface.html
-
Azure: https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface-vm
1. Networking Setup for Multiple Containers for an On-Premise Server
Identify Public IP Address
Use one of the following commands:
curl ifconfig.me
This returns the VM’s public IP, which you'll use in Microsoft 365 connectors or Google Workspace routing.
Identify Private IP Address
hostname -I
or
ip a
You’ll see entries like:
inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0
Or filter using:
ip -4 addr show | grep inet
Add a Secondary IP to the NIC
To assign a new IP:
nmcli con mod ens192 +ipv4.addresses 10.1.2.26/28
nmcli con up ens192
ip a # Verify the IPs
2. Assigning Static IPs in Podman or Docker
Modify the Virtru Gateway Setup Script
Navigate to your scripts directory:
cd /var/virtru/vg/scripts
vi setup-25.sh
Update the --publish line to bind to a specific IP:
Podman Example:
podman run -d \
--env-file /var/virtru/vg/env/vg01.env \
-v /var/virtru/vg/tls/:/etc/postfix/tls \
-v /var/virtru/vg/dkim/:/etc/opendkim/keys \
--publish 10.1.2.27:25:25 \
--restart unless-stopped \
--log-opt max-size=100m \
--log-opt max-file=10 \
containers.virtru.com/gateway:v<version-number>
Docker Example:
docker run -d \
--env-file /var/virtru/vg/env/vg01.env \
-v /var/virtru/vg/tls/:/etc/postfix/tls \
-v /var/virtru/vg/dkim/:/etc/opendkim/keys \
--publish 10.1.2.27:25:25 \
--restart unless-stopped \
--log-opt max-size=100m \
--log-opt max-file=10 \
containers.virtru.com/gateway:v<version-number>
This setup ensures each container:
FeatureDescriptionStatic IP AssignmentEach container listens on its own static IP (e.g., `10.1.2.27`). You can maintain multiple setup scripts with different IPs.Internal Port UsageAll containers use port `25` inside the container, maintaining consistency.No Port ConflictsWith unique IPs or external ports, containers run simultaneously without binding issues.
3. Optional: Use Unique External Ports Instead of IPs
If static IPs are limited, you can map different external ports to port 25:
--publish 9001:25
--publish 9002:25
4. Verification & Testing
List Running Containers
podman ps
docker ps
Check Assigned IPs
ip a
Inspect Network Config
podman network inspect virtru-network
docker network inspect virtru-network
Ping Between Containers
podman exec -it virtru-gateway-1 ping 10.1.2.28
docker exec -it virtru-gateway-1 ping 10.1.2.28
5. Conclusion
This setup offers:
-
✅ Scalability: Run multiple independent containers
-
✅ Compatibility: Supports Microsoft 365 multiple connectors
-
✅ Separation of Policies: Distinct containers for inbound and outbound encryption