jamesmcm/vopono

How do I use `vopono` inside a tmux session?

kohane27 opened this issue · 2 comments

Hello @jamesmcm . Hope you're doing well. Thank you for creating vopono. It's very useful for users like me when I only need to use VPN for only a handful of applications.

I have the following command:

$ vopono --verbose --askpass exec --firewall iptables --provider protonvpn --server japan kitty

such that all commands inside this kitty terminal will be run through protonvpn. To verify I'm connected to vpn:

$ curl ifconfig.co/json | jq .time_zone
"Asia/Tokyo"

However, when I run tmux new and run curl ifconfig.co/json | jq .time_zone again, I'm not connected to vpn.

I'm not sure why this is the case. I just want to run curl through the vpn inside a tmux session.

What I've Tried

  1. Running tmux kill-server before the above vopono command such that no existing server is running.

Remarks

I'm not sure if this is an issue with vopono or openVPN config or tmux issue. Please excuse me if this is unrelated to vopono. Any input is much appreciated. Thank you.

It's probably because tmux is running with a daemon, and so the tmux process itself isn't inside the network namespace.

tmux -D might work to make it not use the server, but I haven't tested it.

Thank you for getting back to me. I really appreciate it.

Thank you for the pointer. It works!

  1. tmux kill-server
  2. vopono --verbose --askpass exec --firewall iptables --provider protonvpn --server japan kitty
  3. tmux

The idea is to run vopono to spawn a terminal, and then run tmux from it, such that all connections from that tmux session is routed through the VPN.

Thank you again and have a good day!