Skip to content

Latest commit

 

History

History
43 lines (36 loc) · 1.4 KB

README.md

File metadata and controls

43 lines (36 loc) · 1.4 KB

tun

This is an easy VPN server example by golang. It support Tun interface only.

+---------------+               +---------------+
|               |               |               |
|               |               |               |
+-------+-------+               +-------^-------+
        |                               |
+-------v-------+  works here   +-------+-------+
|Network Layer  <---------------+Network Layer  |
|Tun Interface  +--------------->Tun Interface  |
+-------+-------+               +-------^-------+
        |                               |
+-------v-------+               +-------+-------+
|Data Link Layer|               |Data Link Layer|
|Tap Interface  |               |Tap Interface  |
+-------+-------+               +-------^-------+
        |                               |
+-------v-------+               +-------+-------+
|Physical Layer |               |Physical Layer |
|               |               |               |
+-------+-------+               +-------^-------+
        |                               |
        +-------------------------------+

Clients.

How to use?

Config your vpn.json first.

Enjoy yourself!

Must open ip_forwarding = 1

iptables -t nat -A POSTROUTING -j MASQUERADE