kylemanna / docker-openvpn

🔒 OpenVPN server in a Docker container complete with an EasyRSA PKI CA
https://hub.docker.com/r/kylemanna/openvpn/
MIT License
8.73k stars 2.39k forks source link

How to whitelist IPs (everything is is blacklist aka not go through vpn) #624

Open ORESoftware opened 3 years ago

ORESoftware commented 3 years ago

I asked this question on devops.stackexchange.com: https://devops.stackexchange.com/questions/12999/how-to-only-go-through-openvpn-server-for-certain-ips

But honestly getting a little frustrated especially considering this seems to be a common need and not finding any answers on le internet, sorry to take it out on our dear readers here.

All I want to do is something like:

# config file
10.28.39.39  only_route_traffic_going_to_this_ip_through_the_vpn

how is this done? is there a build-arg or -e flag for this? thx

erhan- commented 3 years ago

Disable redirect-gateway and set a static route for that host in the configs.

ORESoftware commented 3 years ago

thanks I got an answer on SuperUser, but not sure if it gels with yours? https://superuser.com/a/1611133/1072503

is there an example in the docs for this (how to change config file for server)? happy to do it clientside instead of serverside too. Although clientside is out of your purview, might be easier for this?

to create collapsible sections of readme you can use html elements like:

<details>
<summary>How to whitelist ips</summary>

put some info in here
</details>

appreciate this tool, saved me a lot of time and working great so far.