-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How access other services via VPN's ips #622
Comments
I have the same problem: it's impossible to connect via port 80 to the host 192.168.255.1 (OpenVPN server host) from the VPN client from the same network. How to fix this? |
I have created a network with docker network create and added both the service and the openvpn service to this external network. Then I added the route to the subnet into my client config file. I guess it might also work if you add it to the server:
I can ping and access the internal services this way but I would also like to add a dns service so that the the dns requests are also forwarded through the vpn to the internal dns server. This way I can use the service names as hostname instead of the IPs. |
Something like this works: Create your network
docker-compose.yml
The in the openvpn.conf (I have mounted the volume on my system)
In your client configuration this has to be appended for Linux:
On android I have to add the route and comp-lzo no command as well in the client configuration. Normally these should be pushed but it is not happening somehow. Redirect gateway is off for me. Everything works if all containers use the same network. If you start using multiple networks, I somehow can't contact other subnets. I can pink from within the container to other contains in other connected subnets but the openvpn clients can not. It is a routing issue. The containers from the other network do not know where to route the VPN packages through. You can try by trying to ping from the other network to a VPN client IP for example.
ip_of_VPN is the IP of the VPN server in the other network which you want to reach. This is not described good and I will try to find a better solution first. For a single container you do this:
e.g.
|
@erhan- What you have in your |
Sorry, I gave up doing it this way and simply run openvpn server on the host. Way easier for the setup I want to achieve. Dnsmasq was setup in a way that it only acts as a dns relay and I added all static hosts there iirc. |
I wanted to know if it's possible to access other services, like web GUI from other container without using the server's private network.
Server's and client's private network is 192.168.1.0/24.
I didn't change the vpn's configuration, it's still on 192.168.255.0
How can I access the other container via 192.168.255.1, is it impossible because of the fact that the VPN is in a docker container ?
The text was updated successfully, but these errors were encountered: