Deploying a Network Connector on a Docker container doesn’t support installing the OpenVPN 3 Linux client. To use a Docker container as a Network Connector for CloudConnexa, install the open-source OpenVPN client, OpenVPN 2.
This example uses an Ubuntu 24.04 Docker container.
Step 1: Download and transfer the Network Connector connection profile
- Sign in to your CloudConnexa Portal.
- Click Networks > Networks.
- Click the name of the desired Network.
- Click the Connectors tab for the Network.
- Click the Deploy drop-down.
- Click Download Profile in .ovpn format.
- Transfer the downloaded .ovpn connection profile to your Docker Server using an SCP program such as WinSCP.
- Transfer the .ovpn connection profile to your Docker Container using the docker cp command.
sudo docker cp connector_singapore.ovpn connector-ubuntu-node:/root/
Step 2: Access the Docker Container running in Ubuntu 24.04
Use the following command to access the Docker container from the Docker server:
sudo docker exec -it connector-ubuntu-node /bin/bash
Step 3: Install OpenVPN2
Install the open-source OpenVPN client, OpenVPN 2:
apt install openvpn -y
Step 4: Verify the OpenVPN2 installation
Verify the installed OpenVPN 2 version:
openvpn --version
Step 5: Enable IP Forwarding
Run the following commands to enable IP forwarding:
echo 'net.ipv4.ip_forward=1' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv6.conf.all.forwarding=1' | sudo tee -a /etc/sysctl.conf
sysctl -p
Step 6: Configure NAT
Run the following commands to set up NAT:
IF=$(ip route | grep -m 1 default | awk '{print $5}')
iptables -t nat -A POSTROUTING -o $IF -j MASQUERADE
ip6tables -t nat -A POSTROUTING -o $IF -j MASQUERADE
DEBIAN_FRONTEND=noninteractive apt install -y iptables-persistentStep 7: Configure OpenVPN2 to start automatically on boot
Transfer the .ovpn connection profile to the path
/etc/openvpn/clientand rename it to a client.conf filename:cp connector01_singapore.ovpn /etc/openvpn/client/client.conf
Enable the OpenVPN2 service to run on boot:
systemctl enable openvpn-client@client.service
Restart the OpenVPN2 client service:
systemctl restart openvpn-client@client.service
Conclusion
Your Docker Container should now automatically connect to CloudConnexa as a Network Connector using OpenVPN2 upon boot.
If you have any more questions, please submit a support ticket.
Comments
0 comments
Please sign in to leave a comment.