29

How to use the tun / tap python module (pytun) to create a p2p tunnel?

 3 years ago
source link: https://www.codesd.com/item/how-to-use-the-tun-tap-python-module-pytun-to-create-a-p2p-tunnel.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to use the tun / tap python module (pytun) to create a p2p tunnel?

advertisements

I need to make a simple p2p vpn app, after a lot of searches I found a tun/tap module for python called PYTUN that is used to make a tunnel. How can I use this module to create a tunnel between 2 remote peers?

All the attached doc only show how to make the tunnel interface on your local computer and config it, but it does not mention how to connect it to the remote peer.


pytun is not sufficient for this. It serves to connect your Python application to a system network interface. In effect, you become responsible for implementing that system network interface.

If you want traffic that is routed over that network interface to traverse an actual network, then it is the job of your Python program to do the actual network operations that move the data from host A to host B.

This is probably a lot of work to do well. I suggest you use an existing VPN tool instead.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK