Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TUN/TAP (VPN) support #120

Open
ValdikSS opened this issue Sep 22, 2019 · 11 comments
Open

TUN/TAP (VPN) support #120

ValdikSS opened this issue Sep 22, 2019 · 11 comments

Comments

@ValdikSS
Copy link

Hi, just leaving the links for useful software and libraries to convert TUN/TAP to Socks5/HTTP proxy (OpenVPN as proxy). Hope you'll find them useful.

https://github.com/russdill/tunsocks
tunsocks is a user-level SOCKS, HTTP, and port forwarding proxy for use with VPNs that typically interact with tun devices. Rather than passing bytes to and from the tun device, they can pass the data to and from this user-level program. tunsocks is implemented using lwIP.

https://github.com/cernekee/ocproxy
ocproxy is a user-level SOCKS and port forwarding proxy for OpenConnect based on lwIP. When using ocproxy, OpenConnect only handles network activity that the user specifically asks to proxy, so the VPN interface no longer “hijacks” all network traffic on the host.

@phantomcraft
Copy link

TUN/TAP with IPv6 would be very good.

Another useful feature would be support for listening on Unix Sockets, together with TUN/TAP could provide networking for containers without using network stacks with veth pairs and iptable rules.

@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Feb 20, 2021
@nadoo nadoo removed the Stale label Mar 8, 2021
@nadoo nadoo reopened this Mar 8, 2021
@nil0x42
Copy link

nil0x42 commented Dec 30, 2021

Such feature would be great to have !

something like:

forward=tun-interface://tun0

@phantomcraft
Copy link

Maybe I would pay for this feature.

@nadoo
Copy link
Owner

nadoo commented Jan 26, 2022

Such feature would be great to have !

something like:

forward=tun-interface://tun0

Hi @nil0x42 , I guess you just want to forward requests via an existing tun interface? then you can run glider like:

glider -verbose -listen :8443 -interface=tun0

@nil0x42
Copy link

nil0x42 commented Jan 26, 2022

Such feature would be great to have !
something like:

forward=tun-interface://tun0

Hi @nil0x42 , I guess you just want to forward requests via an existing tun interface? then you can run glider like:

glider -verbose -listen :8443 -interface=tun0

Actually i want to forward requests via multiple existing tun interfaces, with rr strategy

strategy=rr
forward=tun0
forward=tun1
forward=tun2

@nadoo
Copy link
Owner

nadoo commented Jan 26, 2022

Such feature would be great to have !

something like:

forward=tun-interface://tun0

Hi @nil0x42 , I guess you just want to forward requests via an existing tun interface? then you can run glider like:

glider -verbose -listen :8443 -interface=tun0

Actually i want to forward requests via multiple existing tun interfaces, with rr strategy


strategy=rr

forward=tun0

forward=tun1

forward=tun2

How about this?

verbose
listen=:8443
strategy=rr
forward=direct://#interface=tun0
forward=direct://#interface=tun1
forward=direct://#interface=tun2

@nadoo
Copy link
Owner

nadoo commented Jan 27, 2022

Hi @nil0x42 , actually the following config is working start from the version v0.15.0:

verbose
listen=:8443
strategy=rr
forward=direct://#interface=tun0
forward=direct://#interface=tun1
forward=direct://#interface=tun2

@nil0x42
Copy link

nil0x42 commented Jan 28, 2022

Okay, thank you !

@nil0x42
Copy link

nil0x42 commented Mar 19, 2022

Hi ! I've tried this technique with vlan interfaces (secondary ips), and it doesn't work:
$ cat glider.conf

listen=:8444
strategy=rr
forward=direct://#interface=eth0:0
forward=direct://#interface=eth0:1
forward=direct://#interface=eth0:2

$ glider --config glider.conf

2022/03/19 20:24:29 log.go:35: route ip+net: no such network interface: eth0:0

EDIT:

as vlan interface name is not recognized, i've tried directly setting each source ip as interface and it works.
For example:

listen=:8444
strategy=rr
forward=direct://#interface=191.122.51.3
forward=direct://#interface=191.122.51.4
forward=direct://#interface=191.122.51.5

@nadoo
Copy link
Owner

nadoo commented Mar 20, 2022

Hi ! I've tried this technique with vlan interfaces (secondary ips), and it doesn't work: $ cat glider.conf

listen=:8444
strategy=rr
forward=direct://#interface=eth0:0
forward=direct://#interface=eth0:1
forward=direct://#interface=eth0:2

$ glider --config glider.conf

2022/03/19 20:24:29 log.go:35: route ip+net: no such network interface: eth0:0

You can use the interface names showed by ip add, a vlan interface eth0.1 should work, but not the sub interface eth0:1

Repository owner deleted a comment from deenMuhammad Feb 1, 2024
Repository owner deleted a comment Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants