What is the rationale for developing a simple VPN server with Python?

Source: Internet
Author: User
Running when the brain hole open, think of yourself to write a simple VPN server, search, there are a lot of ready-made libraries or components, but curious if you want to use Python development, how can it be implemented?

Reply content:

If just implementing a simple VPN, personal use, is really very simple. The code amount is up to hundreds of lines.
Because the core of the operating system now has built-in TUN/TAP support, the application layer can easily establish the point-to-point tunnel and generate the virtual network card through the corresponding interface. After that, it is OK to set up the system data forwarding through the tools such as iptables. This is also true of the basic VPN now.


About Tun/tap:
https:// Zh.m.wikipedia.org/wiki /tun


A very simple implementation version of Linux C:
https:// Github.com/cloudwu/mptu N
Similar to Python implementations, the basic process is to open the/dev/net/tun operation Tun interface, such as TCP or UDP to set up a data forwarding channel to forward data.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.