Skip to content

Commit 35a7f8e

Browse files
Copilotdvershinin
andcommitted
Add VPN compatibility documentation section to README
Co-authored-by: dvershinin <250071+dvershinin@users.noreply.github.com>
1 parent 1f4b20b commit 35a7f8e

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,64 @@ WantedBy=multi-user.target
152152
- Port publishing must include IPv6 (Docker binds to IPv6 only if daemon IPv6 is enabled). See Docker docs for `daemon.json` (`"ipv6": true`, `"fixed-cidr-v6": "…/64"`).
153153
- The provided image’s default entrypoint does not add `-6`. To use IPv6, either run MTProxy on the host, or build/override the container command to include `-6`.
154154

155+
## VPN Compatibility
156+
157+
MTProxy works with VPN by default. However, if you experience connectivity issues when your VPN is active, check your configuration.
158+
159+
### Default Behavior (VPN-friendly)
160+
161+
By default, MTProxy:
162+
- Listens on all network interfaces (`0.0.0.0` for IPv4, `::` for IPv6)
163+
- Routes outbound connections automatically through the system's default route (including VPN tunnels)
164+
165+
**This means you don't need any special configuration for VPN compatibility.**
166+
167+
### The `--address` Option
168+
169+
The `--address` option binds **outbound connections** (connections from the proxy to Telegram servers) to a specific IP address.
170+
171+
**When to use `--address`:**
172+
- Multi-homed servers with multiple public IPs where you need to control which IP is used for outbound connections
173+
- NAT scenarios where the local address differs from the global address (use with `--nat-info`)
174+
- Specific routing requirements
175+
176+
**When NOT to use `--address`:**
177+
- ❌ When running a VPN on the same server
178+
- ❌ On most single-IP servers (let the system route automatically)
179+
- ❌ When you want traffic to go through a VPN tunnel
180+
181+
**Example with `--address`:**
182+
```bash
183+
./mtproto-proxy -u nobody -p 8888 -H 443 -S <secret> --address 10.0.1.5 --aes-pwd proxy-secret proxy-multi.conf -M 1
184+
```
185+
186+
### Troubleshooting VPN Issues
187+
188+
If the proxy doesn't work when your VPN is active:
189+
190+
1. **Remove the `--address` option** if you're using it. The default behavior routes through VPN automatically.
191+
192+
2. **Check your VPN routing table**:
193+
```bash
194+
ip route show
195+
# Verify that default route points to your VPN interface
196+
```
197+
198+
3. **Verify the proxy can reach Telegram servers**:
199+
```bash
200+
# From the server where MTProxy runs
201+
curl -I https://core.telegram.org/
202+
```
203+
204+
4. **Check firewall rules** - ensure your VPN doesn't block the proxy port:
205+
```bash
206+
# Allow incoming connections on port 443
207+
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
208+
```
209+
210+
5. **For split-tunnel VPNs** - ensure Telegram's IP ranges route through the tunnel, not the regular interface.
211+
212+
155213
## Transport Modes and Secret Prefixes
156214

157215
MTProxy supports different transport modes that provide various levels of obfuscation:

0 commit comments

Comments
 (0)