Skip to content

Latest commit

 

History

History
102 lines (81 loc) · 5.33 KB

README-OpenFortiVPN.md

File metadata and controls

102 lines (81 loc) · 5.33 KB

DevOpsCorner OpenFortiVPN

DevOps Corner Indonesia - OpenFortiVPN Client Container Image

all contributors tags openfortivpn pulls download all view clone issues pull requests forks stars license


Container devopscorner/openfortivpn Available Tags

Ubuntu

Image name Size
devopscorner/openfortivpn:latest docker image size default-openfortivpn
devopscorner/openfortivpn:22.04 docker image size latest-ubuntu
devopscorner/openfortivpn:22.04-latest docker image size
devopscorner/openfortivpn:22.04-1.19.0 docker image size
devopscorner/openfortivpn:20.04 docker image size
devopscorner/openfortivpn:20.04-latest docker image size
devopscorner/openfortivpn:20.04-1.19.0 docker image size

Environment

ENV VPN_HOST host
ENV VPN_PORT port
ENV VPN_ADDR host:port
ENV VPN_USER user@domain
ENV VPN_PASS secret
ENV VPN_TRUST_CERT 1234567890987654321
ENV VPN_TIMEOUT 10

Linux

# Create a docker network, to be able to control addresses
docker network create --subnet=172.20.0.0/16 openfortivpn

# Start the priviledged docker container with a static ip
docker run -it --rm \
  --privileged \
  --net openfortivpn --ip 172.20.0.2 \
  -e VPN_HOST=host \
  -e VPN_PORT=port \
  -e VPN_ADDR=host:port \
  -e VPN_USER=user@domain \
  -e VPN_PASS=secret \
  -e VPN_TRUST_CERT=1234567890987654321
  devopscorner/openfortivpn

# Add route for you remote subnet (ex. 10.201.0.0/16)
ip route add 10.201.0.0/16 via 172.20.0.2

# Access remote host from the subnet
ssh 10.201.8.1

OSX

# Create a docker-machine and configure shell to use it
docker-machine create openfortivpn --driver virtualbox
eval $(docker-machine env openfortivpn)

# Start the priviledged docker container on its host network
docker run -it --rm \
  --privileged --net host \
  -e VPN_HOST=host \
  -e VPN_PORT=port \
  -e VPN_ADDR=host:port \
  -e VPN_USER=user@domain \
  -e VPN_PASS=secret \
  -e VPN_TRUST_CERT=1234567890987654321
  devopscorner/openfortivpn

# Add route for you remote subnet (ex. 10.201.0.0/16)
sudo route add -net 10.201.0.0/16 $(docker-machine ip openfortivpn)

# Access remote host from the subnet
ssh 10.201.8.1

Misc

If you don't want to use a docker network, you can find out the container ip once it is started with:

# Find out the container IP
docker inspect --format '{{ .NetworkSettings.IPAddress }}' <container>