How to bypass a VPN on Ubuntu laptop

Re: Ubuntu 24.04 LTS on a typical Dell laptop.

Hi.

As advised, I’d like to run the Tor browser separately from the VPN connection that is kept on all the time.

The VPN app does not have a Split-Tunneling feature like its Windows version. Instead, it has an Allowlist where one can enter a port to exclude from the VPN connection . I tried a few (and accordingly in Tor’s settings) and each time Tor did not connect when the VPN was disabled. When enabled and Tor connects, I’m not sure how to tell if it’s over or separate from the VPN.

The app’s Kill Switch is enabled and I don’t want to disable it. My level of knowledge says the Allowlist port would not be affected by the Kill Switch.

Can someone please explain in simple language how to achieve the objective? The specific port number or what else to do? Perhaps the issue is how I entered the info in Tor’s settings.

Sam

I would try port 9050 or 9150 or maybe both together or each separately. I’m basing this on my Windows version of Tor where tor.exe starts its proxy on 9050 when started alone or 9150 when the Tor browser starts it.

How to tell? There is a utility called TCPview which can be installed on Ubuntu. I have it on a test Ubuntu. This would tell you what port(s) the browser has open.

Or, if you feel masochistic, you could read the docs for either the netcat or the ss command and figure out which options you need out of the dozens of options to see what ports are opened or listening.

Hi Sam,

The reason Tor fails to connect when your VPN is disabled is due to the VPN’s Kill Switch. The Kill Switch blocks all network traffic that isn’t actively routed through the VPN tunnel, which prevents Tor Browser from reaching the internet directly.

Additionally, configuring port settings inside Tor Browser only changes which outgoing ports Tor uses to connect to relays (usually to bypass restrictive firewalls)—it doesn’t instruct Ubuntu to route Tor around the VPN interface.

Because your VPN’s Linux app lacks native split-tunneling, here is how you can handle this:

Method 1: Use a Virtual Machine (Easiest & Safest)
The simplest way to run Tor entirely separate from your host OS’s VPN and Kill Switch is using VirtualBox:

Install VirtualBox on Ubuntu.

Set up a lightweight Linux guest OS (or Tails/Whonix).

Set the VM’s network adapter to Bridged Networking (instead of NAT). This gives the VM its own direct connection to your router, bypassing your laptop’s VPN and Kill Switch completely.

Method 2: Linux Network Namespaces (netns)
If you prefer not to use a VM, you can create a separate network namespace in Ubuntu that bypasses the VPN tunnel and connects directly to your physical interface (eth0 or wlan0).

You can launch Tor inside that namespace via terminal:

Bash
ip netns exec novpn tor-browser
How to verify if Tor is separate from your VPN:
In your regular Ubuntu terminal, check your IP by running:

Bash
curl ifconfig.me
(This should show your VPN server’s IP).

Open Tor Browser and visit check.torproject.org.

Click the padlock icon next to the address bar to view your Tor Circuit.

The first node listed is your Guard Node. Check the Tor logs or circuit details—if the entry connection originates directly from your home ISP rather than your VPN IP, your traffic is successfully bypassing the VPN!

Thank you, Prince! And Bobby.

I had tried many ports and combinations without success, and figured there must be a deeper reason.

I was not quite clear with my answer. I meant put those ports I mentioned in the VPN’s allowlist if you are correct about the allowlist.

If not, then I defer to Prince73.

You’re welcome, Sam! Happy to help. Good luck with the setup!:smiling_face_with_three_hearts:

Yes, I put those port numbers and others in the Allowlist (and in Tor’s settings for bypassing a firewall in Connections>Advanced).

Oh, I did try all options with Kill Switch off and it did not make a difference.

After some back-and-forth with my VPN provider, they finally said:

Unfortunately, as Tor Browser does not use one fixed destination subnet or one fixed port you can safely whitelist to make it bypass the VPN. it will not be possible to completely whitelist the browser from the VPN connection.

The traffic can use common ports like 9001, 443, 80, but it can also use other ports and as such whitelisting everything can make the whitelist also affect other traffic too, not just Tor Browser.

In this case, we can only suggest not using the VPN connection while using the Tor browser, or using it throught the VPN tunnel, using a VPN on top of the Tor browser will help with Hiding Tor usage from your ISP.

That reply of mine is completely wrong. I take it back. Port 9150 or 9050 is what the Tor browser uses to contact the Tor proxy it starts on the system. I just used TCPview on a Win11 and it struck me how wrong that reply was. :flushed_face: