{"id":18410830,"url":"https://github.com/wayofthepie/vpner","last_synced_at":"2026-04-18T09:33:07.746Z","repository":{"id":141925790,"uuid":"89784046","full_name":"wayofthepie/vpner","owner":"wayofthepie","description":"Replace AnyConnect with Openconnect ","archived":false,"fork":false,"pushed_at":"2017-04-29T12:37:42.000Z","size":4,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-20T09:48:47.262Z","etag":null,"topics":["docker","openconnect","vpn"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wayofthepie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-29T12:31:17.000Z","updated_at":"2020-04-14T18:01:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"b613616b-06f7-4425-8cd2-11798f1e3255","html_url":"https://github.com/wayofthepie/vpner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wayofthepie/vpner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofthepie%2Fvpner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofthepie%2Fvpner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofthepie%2Fvpner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofthepie%2Fvpner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wayofthepie","download_url":"https://codeload.github.com/wayofthepie/vpner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofthepie%2Fvpner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31963966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","openconnect","vpn"],"created_at":"2024-11-06T03:34:04.493Z","updated_at":"2026-04-18T09:33:07.728Z","avatar_url":"https://github.com/wayofthepie.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vpner\nThis repository contains\n\n  * The `csd` script necessary to connect to a VPN which expects an AnyConnect client.\n  * Instructions on how to get openconnect to work using this `csd` script.\n  * A `docker`image to wrap it all up.\n\n# Openconnect On The Host\nIf you just want to run openconnect, replacing your use of AnyConnect you first need to\nupdate `CSD_HOSTNAME` in [csd.sh](csd.sh). The value of\n`CSD_HOSTNAME` is `VPN_URL`, replace this with your VPN's url.\n```\nCSD_HOSTNAME=my-vpn.com\n```\nNow, run open connect setting `--csd-user` to the user _on your system_ which will run\nthe CSD script, `${VPN_USER}` to the user you want to login to the VPN with and `${VPN_URL}`\nto the URL of the VPN you are logging into.\n```\n$ sudo openconnect -u${VPN_USER} ${VPN_URL} --csd-user=root --csd-wrapper=/var/tmp/csd.sh\n```\n\n# Openconnect In Docker\nIt is also possible to run openconnect inside a docker container and route traffic from the\nhost through the container. To do this first build this repo's image.\n\n```\n$ docker build --tag vpner .\n```\n\nNow run a container as follows:\n\n```\n$ docker run -ti --name vpner -e VPN_URL=${VPN_URL} -e VPN_USER=${VPN_USER} --privileged --cap-add=ALL vpner\n```\n\nThis will run the [init.sh](init.sh) script which sets up forwarding via `iptables` within\nthe container and starts `openconnect` as outlined above. The first time this is run it will\nhave to pull down a bunch of libs and executables so may take a minute or so. The first\nprompt will be a prompt for _PASSCODE_ you can just hit return here and then it will prompt\nfor your correct credentials. Once you are logged in, you can enter the container via\n`docker exec -ti vpner bash` and ping a host on your vpn.\n\n## Host Through Container Routing\nThe container will now allow forwading through it and then along the `tun` device that `openconnect`\nsets up. The last thing you need to do to get the host access to the VPN is to set up a\nroute through the container. Run the following to get the IP of the container:\n\n```\n$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' vpner\n172.17.0.2\n```\nFinally, set up a route:\n\n```\n$ sudo ip route add 10.0.0.0/8 via 172.17.0.2\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayofthepie%2Fvpner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwayofthepie%2Fvpner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayofthepie%2Fvpner/lists"}