This project is built off / inspired by the work provided here: docker-forticlient
Instead of messing with routes and such like the above, this just uses IPTables to perform port forwarding of mapped ports. For example, you only need RDP access to a specific server over the VPN. By default, this works with SSH, RDP, VNC, and WinRM; and it is easily modifiable for other ports / services as well.
Here are a list of the required environment variables:
VPNADDR: Url of the VPN with port. For example, fortigate.example.com:8443VPNHASH: Hash of the certificate used by the VPNVPNUSER: Username for the user connecting to the VPNVPNPASS: Password of the user connection to the VPNHOSTIP: IP of the host you want to connect to on the other sideMake sure to run this container with privileged access. Otherwise you cannot use PPPD which the VPN relies on.
The below example shows how to run it with every port. After executing the below, you could use mstsc 127.0.0.1:33389 or ssh 127.0.0.1 -p 22222 or etc to reach your specified host.
docker run --restart=always --privileged -d -it \
--name="VPNConnection" \
-p 22222:22222 \
-p 33389:33389 \
-p 55900:55900 \
-p 55985:55985 \
-e VPNADDR="fortigate.example.com:8088" \
-e VPNHASH=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-e VPNUSER=admin \
-e VPNPASS="password" \
-e HOSTIP=172.20.1.30 \
soarinferret/fortivpn
A docker-compose.yml file is included for your convienence. I use a similar docker-compose file to stand up around 10 VPNs to different locations.
# Using docker-compose
# Make sure to edit the environment variables within the docker-compose file
docker-compose up
If you want to modify the container and update it with different functionality, follow the steps below:
# download
git clone https://github.com/SoarinFerret/linux-fortissl.git
# make your changes
# build
docker build -t fortivpn .
Content type
Image
Digest
Size
48.3 MB
Last updated
about 7 years ago
docker pull soarinferret/fortivpn