Git Product home page Git Product logo

docker-ipsec-vpn-client's Introduction

Docker image for IPsec VPN Client

ipsec-vpn-client is a VPN client that can help easy setup IPSec VPN client in Docker and used by the host by managing default IP route.

This image is inspired from configure Linux VPN client using the command line instructions and is tested with IPsec VPN Server on Docker.

By using Docker privileged and host network, the container will update the default route in Linux once start successfully. The router setting will be restored once stop Docker.

How to use this Docker image

Environment variables

This Docker image uses the following variables, and can be easily managed via env file:

VPN_SERVER_IP=your_vpn_server_public_ip
VPN_IPSEC_PSK=your_ipsec_pre_shared_key
VPN_USER=your_vpn_username
VPN_PASSWORD=your_vpn_password)
VERBOSE=true|false

Start the IPSec VPN Client

Prepare env file vpn.env (recommended way) or use environment variables directly to create Docker container:

docker run --rm --name vpn-client --env-file=./vpn.env -d --privileged --net=host fengzhou/ipsec-vpn-client

To see more debug information, please set VERBOSE=true in enviornment variable in env file.

Stop the IPSec VPN Client

Use docker stop command can immediately stop VPN client:

docker stop vpn-client

The default VPN routing rules will be removed once stopped, and the temporary Docker container will be removed as well.

Troubleshooting

Use the following command to check connection logs during container is running:

docker logs vpn-client

Use the following command to check if ppp0 network interface is created or not:

ip a show ppp0

If network route is not fully restored back, use the following command to remove any broken route rule:

route del default dev ppp0

Limitations

  • The docker-ipsec-vpn-server and this vpn client cannot be used together on the same host due to 500/udp, 4500/udp ports conflicts
  • All existing default route will be redirected to VPN server and need manual route rule to split tunnel.

docker-ipsec-vpn-client's People

Contributors

feng-zh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.