HirbodBehnam / MTProtoProxyInstaller

One-click script to install MTProto Proxy server on CentOS, Ubuntu and Debian
MIT License
824 stars 166 forks source link

With Openvpn on same server #24

Closed x0r2d2 closed 4 years ago

x0r2d2 commented 4 years ago

Good day! I have an issue and I don't know how to solve it. Tried Googling but I didn't find any solution (may be I am blind). Info:

  1. Telegram Proxy and Openvpn server are living on the same server (same ip).
  2. I am using Openvpn on my router. Default route - everything through VPN.

Issue: When I am connected to my home network (VPN), I am not able to reach my Telegram proxy through global ip address, I can reach it only through Openvpn's internal network (e.g. 10.3.0.1).

Question: What iptables rule I have to input on my server, so I will be able to communicate with telegram proxy whem I am in my home network (VPN)? Or I have to setup port-forwarding on router?

My iptables rules:

*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A POSTROUTING -s 10.3.0.0/24 -o eth0 -j MASQUERADE
COMMIT
# Completed on Sat May  2 13:17:09 2020
# Generated by xtables-save v1.8.2 on Sat May  2 13:17:09 2020
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i eth0 -p udp -m udp --dport 53210 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i tun0 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A FORWARD -i tun0 -o eth0 -j ACCEPT
-A FORWARD -i eth0 -o tun0 -j ACCEPT
COMMIT
HirbodBehnam commented 4 years ago

I don't know I haven't worked with internal networks and loopbacks through VPNs. Plus this is not an script issue.