How to use v2ray with VPN (inside a docker)? #2325
Replies: 2 comments 1 reply
-
What is your server's routing table? Can you ssh into the server when VPN is up? |
Beta Was this translation helpful? Give feedback.
-
I finally find a workaround. However, I still wonder why my original method does not work. Idea.This is quite similar to this link, I install v2ray and VPN in docker as it did. However, that link used Dante in the docker to listen to a port, but I want to use v2ray instead. Compared with my original method, this idea is like this:
My setting:v2ray_on_vps:
In fact I use add another inbound with different port, and routing that inbound to My docker-compose.yml
And the v2ray_config.json used for v2ray in the docker:
PS: about using shadowsocks with VPN inside the dockerI also tried the shadowsocks setting:
I tested this setting on a VPS of which the ipv4 address is banned by the GFW. It works fine under ipv6. I did not conduct further experiments since I do not have enough VPS with a useful ipv4 address. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
what I want to do
I want to use V2ray to access a VPN service. I think in this way, we can also break through the limit of the number of devices by VPN vendor.
I install VPN and v2ray on a docker on VPS. So when the client accesses the port of V2ray, since v2ray is using VPN, the client can also get access to the VPN service.
my problem
When my client uses the IPV4 address of VPS to access v2ray, it does not work. But by using the IPV6 address of VPS, my client succeed to access the VPN service.
In contrast, if I set v2ray in docker without VPN, both IPV4 and IPV6 addresses work.
my workflow
I am using ExpressVPN, this docker image is https://github.com/polkaned/dockerfiles/tree/master/expressvpn. The VPN is not free, you may need to pay for that VPN to reproduce my problem. However, the VPN support refunding in 30 days, so don't worry!
I tried to use your image together with the official v2ray image.
My docker-compose.yml
And FYI, I create a v2ray_config.json in the same directory, using the simplest setting provided in the v2ray website
And my client's v2ray setting is also simple:
log file
In the docker in VPS, I get the the following error.txt. To be honest, this version is a setting that using websocket, and the actual port is 43869 which is slightly different from the setting I provided above. I think this difference may be not important.
Beta Was this translation helpful? Give feedback.
All reactions