Comments (2)
Hi -- I think I can spot 2 problems:
-
as you suspected, port forwarding is done over virtio-vsock. There are 2 parts to this: the control interface is currently a 9P filesystem mount manipulated by
vpnkit-expose-port
(although we'll probably replace this with GRPC or similar at some point). Once the port is "exposed" andvpnkit
is listening on the host, incoming connections are forwarded overAF_VSOCK
connections to a server process calledvpnkit-forwarder
-- I suspect this will fail to start if the kernel doesn't support the address family. -
secondly, I think there's a minor problem in the
vpnkit-expose-port
command line. When incoming connections are forwarded,vpnkit
writes a short header tellingvpnkit-forwarder
the final destination to connect to which is thecontainer-ip
on thevpnkit-expose-port
command line. So I think you to give it an IP bound inside the VM instead of0.0.0.0
:
~/vpnkit-expose-port.linux -i -host-ip 127.0.0.1 -host-port 8000 -container-ip 127.0.0.1 -container-port 8000 -no-local-ip
At one point in the past we did support using the internal network for port forwarding but unfortunately that code was removed :(
Another way you could set up access would be a reverse port forward with ssh
-- inside the VM you should be able to ssh <vpnkit gateway IP> -R localhost:8000:127.0.0.1:8000
(if I've remembered the syntax properly). This will connect to the host's sshd
and tell it to listen on localhost:8000
(on the host) and forward connections back to 127.0.0.1:8000
in the VM.
In case it's helpful, recent versions of vpnkit
should respond to DNS queries for docker.for.mac.localhost
with the vpnkit IP. (Although we'll probably have to change the DNS name used since we shouldn't have used localhost
)
Hope this helps a little!
from vpnkit.
Hey djs55,
thank you so much for the info, you've cleared up a lot of for me. Reverse port forwarding sounds like a more flexible solution for my needs.
Thanks again!
-G
from vpnkit.
Related Issues (20)
- fail to build on debian11 (arm64)
- Consider adopting chipmk/docker-mac-net-connect strategy to provide host to container access
- TCP traceroute doesn't show hops icmp works fine
- Port <xxxx> for service <abc> is already opened by another service
- Error on writing log HOT 2
- Any progress to get traceroute working on Windows (Docker with Linux images)
- Random outbound connection timeouts based on server load HOT 16
- kubernetes pod crashloopbacking
- Resource leak spawning uname subprocess call on Darwin
- ocaml-ci: arm64 linking error
- ocaml-ci: cannot find -lrt / cannot find -lpthread
- VPNKit very high idle network usage HOT 2
- EXC_BAD_ACCESS (camlLuv__Helpers__set_reference_inner_1334 + 40)
- vpn如何卸载干净,影响我开发,很郁闷,拦截我所有的地址 HOT 1
- How to uninstall vpn cleanly, which affects my development. I am very depressed and block all my addresses
- Updating Kubernetes to a later version
- vpnkit crashing on intel macOS 12.6.1 with EXC_BAD_ACCESS (SIGSEGV) HOT 13
- Compilation error due to "Unbound module Ethernet__Ethernet_wire" HOT 7
- DNS issue only in kubernetes on a windows host
- level=error msg="Port 30000 for service order-svc is already opened by another service HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vpnkit.