Sample Header Ad - 728x90

Binding a browser to a specific network interface

1 vote
0 answers
391 views
Currently, if I go to sites with a VPN on, it'll route traffic through the VPN. If the VPN is off, then it'll just route the traffic through Wi-Fi/ethernet (whichever one is connected). I want it so that Chrome can only connect to the internet if my VPN is active, otherwise going to a website without my VPN on should show an error that I'm not connected to the internet (even if I actually am). The closest program that I know that allows this behavior is qBittorrent , where it will only connect to peers if the network interface specified is up and running. This leads me to believe that other programs have the capability of binding to a specific network interface I know the following from running ifconfig: - My VPN runs on the utun4 network interface - The ethernet port (I usually keep Wi-Fi disabled) runs on en7 I know that on Linux, you can accomplish this by using firejail with firejail --net=utun4 /path/to/chrome, and maybe on Windows using ForceBindToIP. On macOS, firejail doesn't work because it takes advantage of ip netns, something that macOS doesn't have. Additionally, my VPN connects to a different IP every time I ask it to connect, so this guide I found can't be applied as it relies on you knowing the IP address your VPN connects to. I am using macOS Sequoia 15.1. Chrome is the browser I am using, but I don't mind solutions for Firefox / other Chromium-based browsers as well. I have tried using Squidman as a proxy, but am unsure as to how to accomplish what I want.
Asked by Meh. (456 rep)
Jan 6, 2025, 02:29 AM
Last activity: May 15, 2025, 08:08 PM