Blame

f12081 Samuli Seppänen 2025-02-27 12:14:46 1
# Introduction 
2
3
Sometimes it's useful to obfuscate the fact that your traffic is generated by OpenVPN. For example, if your ISP is blocking OpenVPN for some reason. This article describes various ways to obfuscate OpenVPN traffic so that it's not as easily detected and blocked. Most of the content here originates from [this email thread](http://thread.gmane.org/gmane.network.openvpn.devel/5386). Additionally, for some reason [this mail](http://sourceforge.net/mailarchive/message.php?msg_id=28851866) was not included in Gmane archives.
4
5
# Use static keys
6
7
This was suggested [here](http://thread.gmane.org/gmane.network.openvpn.devel/5386):
8
9
```
10
"My recent suggestion to someone regarding this was to use a
11
static-key tunnel to encapsulate a second secure channel (either
12
openvpn with TLS or ssh(1) as needed.) The static key tunnel looks
13
like random junk to a sniffer. Nothing should identify it as being
14
openvpn."One
15
16
"That said, it DOES look suspicious. Maintain a moving target if
17
possible ... changing ports and IP addresses. Also, because of the
18
potential weakness of static keys, you should rotate them on a
19
timetable, such as weekly or monthly."
20
```
21
22
# Use obfsproxy
23
24
[Obfsproxy](https://www.torproject.org/projects/obfsproxy-instructions.html.en) is a [Tor](https://www.torproject.org/) subproject. It can be used to obfuscate (any) traffic so that it becomes unrecognizable. Obfuscating OpenVPN traffic using obfsproxy was suggested [http://thread.gmane.org/gmane.network.openvpn.devel/5386 here], with one additional mail available [http://sourceforge.net/mailarchive/message.php?msg_id=28851866 here]:
25
26
```
27
"However, the obfsproxy project sounds very interesting. And it should be
28
possible to use obfsproxy (as it can talk like a SOCKS proxy) with
29
OpenVPN, by using the --socks-proxy argument. But I'm not aware of any
30
openvpn services providing obfsproxy services in conjunction with OpenVPN."
31
```
32
33
34
## A quick obfsproxy setup
35
36
This setup will start obfsproxy on your openvpn server, listening to the port 21194. On the client it will start a obfsproxy serving as a SOCKS proxy, listening on the client on port 10194. The part which says "<some-random-key>" needs to be the same value on both server and client. The key can be a longer text string, with just random letters. I'd recommend to keep it long (at least 32 characters, which is 256 bits).
37
38
### Client side
39
Add the following lines to your existing openvpn config file:
40
41
```
42
socks-proxy-retry
43
socks-proxy 127.0.0.1 10194
44
```
45
46
and change the --remote option to be
47
```
48
remote <YOUR-VPN-SERVER> 21194
49
```
50
51
That is, changing the port number to match the port number the server side obfsproxy will listen to.
52
53
Then start the obfsproxy like this:
54
55
```
56
[user@host: ~] $ obfsproxy --log-file=obfsproxy.log --log-min-severity=info obfs2 \
57
--shared-secret=<some-random-key> socks 127.0.0.1:10194
58
```
59
60
### Server side
61
Here we tell obfsproxy to listen to TCP port 21194 and to send any obfsproxy clients to the OpenVPN server, listening on 127.0.0.1, port 1194. And remember to allow TCP connections from the "outside" to port 21194 in your firewall config. Start obfsproxy like this:
62
```
63
[user@host: ~] $ obfsproxy --log-file=obfsproxy.log --log-min-severity=info obfs2 \
64
--dest=127.0.0.1:1194 --shared-secret=<some-random-key> server 0.0.0.0:21194
65
```
66
67
The OpenVPN server needs in this case just this line in the config:
68
```
69
port 1194
70
```
71
72
That's all the magic, and should be a complete working setup.
73
74
A user provided an OpenVPN installer which bundles OpenVPN with obfsproxy. Look [http://sourceforge.net/mailarchive/message.php?msg_id=28851866 here] for downloads and instructions.