TCP server exposure through VPN

0

I have an issue for exposing a TCP service through VPN. I am using OpenVPN through Tunnelblick application under MacOS.

ifconfig give me following output for my VPN network interface :

$ifconfig tun0
tun0: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet A.B.C.D --> A.B.C.D+1 netmask 0xffffffff
    open (pid 46308)

If I run any service let say following Python Flask endpoint (also tested Netcat or Socat listening but same issue reached) :

from flask import Flask
f = Flask('test')
@f.route('/'):
def ping():
    return 'it works\n'
f.run(host='A.B.C.D')

I assume that the underlying created socket / TCP connection will be bound to the tun0 interface as the used binding IP address is the one belonging to this network interface.

Any attempt to reach this web service will lead then to a timeout : locally or from another machine connected to the same VPN.

$ ping A.B.C.D
   -> OK
$ curl A.B.C.D:5000
   -> Request timeout

I have no clue about what is going on, suspected MacOS unwanted behaviour, but the same test from a Linux machine belonging to the same VPN lead to the same problem.

Thanks in advance.

python
macos
flask
tcp
openvpn
asked on Stack Overflow May 13, 2019 by Faylixe • edited May 13, 2019 by Faylixe

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0