1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-01-18 04:59:16 +02:00

94 lines
2.2 KiB
Markdown
Raw Normal View History

2015-04-30 18:08:49 +08:00
OpenVPN over Obfsproxy
======================
2015-05-24 12:23:19 +08:00
`Obfsproxy` is a pluggable transport proxy written in python.
It provides several obfuscation method. I consider `scramblesuit` the best.
2015-04-30 19:39:20 +08:00
I will update this image if there's better one.
2015-05-24 12:23:19 +08:00
![obfsproxy](http://www.cs.kau.se/philwint/scramblesuit/images/big_picture.png)
`scramblesuit` can transport any application that supports SOCKS.
This includes `Tor`, `VPN`, `SSH`, and many other protocols.
We can transport `OpenVPN` over `Obfsproxy`, so that firewall cannot detect it.
2016-04-02 08:19:22 +08:00
In the following example, you should run `vimagick/openvpn` container first.
2015-05-24 12:23:19 +08:00
Don't forget to edit `/etc/openvpn/openvpn.conf` to use `proto tcp`.
2015-04-30 18:32:52 +08:00
2015-04-30 18:08:49 +08:00
## docker-compose.yml
```
2015-04-30 19:39:20 +08:00
data:
2016-04-02 08:19:22 +08:00
image: busybox
2015-04-30 19:39:20 +08:00
volumes:
2015-04-30 19:50:32 +08:00
- /etc/openvpn
2015-04-30 19:39:20 +08:00
server:
2016-04-02 08:19:22 +08:00
image: vimagick/openvpn
2015-04-30 19:39:20 +08:00
ports:
2015-04-30 19:50:32 +08:00
- "1194:1194/tcp"
2015-04-30 19:39:20 +08:00
volumes_from:
2015-04-30 19:50:32 +08:00
- data
2015-04-30 19:39:20 +08:00
cap_add:
2015-04-30 19:50:32 +08:00
- NET_ADMIN
2015-04-30 19:39:20 +08:00
restart: always
2015-04-30 18:08:49 +08:00
obfsproxy:
2016-04-02 08:19:22 +08:00
image: vimagick/obfsproxy
2015-04-30 18:08:49 +08:00
ports:
- "4911:4911"
links:
2015-04-30 19:39:20 +08:00
- server:openvpn
environment:
- PASSWORD=J23TNHPJPAOQJLTCPLFD4CQYVFY6MEVP
2015-05-01 17:54:38 +08:00
- DEST_ADDR=openvpn
2015-04-30 19:39:20 +08:00
- DEST_PORT=1194
- LISTEN_ADDR=0.0.0.0
- LISTEN_PORT=4911
restart: always
```
To link a existing `openvpn` container, please use `external_links` instead of `links`.
2015-04-30 19:46:33 +08:00
```
2015-04-30 19:39:20 +08:00
obfsproxy:
2016-04-02 08:19:22 +08:00
image: vimagick/obfsproxy
2015-04-30 19:39:20 +08:00
ports:
- "4911:4911"
external_links:
2015-04-30 18:08:49 +08:00
- openvpn_server_1:openvpn
environment:
- PASSWORD=J23TNHPJPAOQJLTCPLFD4CQYVFY6MEVP
2015-05-01 17:54:38 +08:00
- DEST_ADDR=openvpn
2015-04-30 18:08:49 +08:00
- DEST_PORT=1194
- LISTEN_ADDR=0.0.0.0
- LISTEN_PORT=4911
restart: always
```
2015-05-01 17:17:40 +08:00
The default run mode is `server`. You can also run container in `client` mode.
The following example shows us how to make a OpenVPN relay:
2015-05-01 16:25:42 +08:00
```
obfsproxy:
2016-04-02 08:19:22 +08:00
image: vimagick/obfsproxy
2015-05-01 17:17:40 +08:00
ports:
2015-05-01 17:49:42 +08:00
- "1194:1194/tcp"
2015-05-01 16:25:42 +08:00
environment:
2015-05-01 17:17:40 +08:00
- PASSWORD=J23TNHPJPAOQJLTCPLFD4CQYVFY6MEVP
2016-05-01 09:06:20 +08:00
- DEST_ADDR=vpn.easypi.info
2015-05-01 17:17:40 +08:00
- DEST_PORT=4911
2015-05-01 16:25:42 +08:00
- RUN_MODE=client
2015-05-01 17:17:40 +08:00
- LISTEN_ADDR=0.0.0.0
2015-05-01 17:49:42 +08:00
- LISTEN_PORT=1194
2015-05-01 17:17:40 +08:00
restart: always
2015-05-01 16:25:42 +08:00
```
2015-04-30 19:39:20 +08:00
The password should be encoded by Base32 with fixed length.
You can generate one via this command:
2015-04-30 19:46:33 +08:00
```
2015-04-30 19:39:20 +08:00
python -c 'import base64, os; print base64.b32encode(os.urandom(20))'
```
2015-05-12 16:49:35 +08:00
Note: There's no ports exposed in Dockerfile. You need to expose port explicitly.