-2

Use Case: I need to access a website (e.g., chatgpt.com), which is restricted on my Wi-Fi network but accessible via a hotspot connected to my Mac through the Ethernet port.

Network Setup:

Wi-Fi: Connected to my regular network (for example, chatgpt.com is blocked)

Ethernet: Connected to a hotspot device (for example, chatgpt.com is accessible)

Objective: I’d like to configure my system so that only Chrome or Firefox routes traffic through the hotspot (Ethernet), specifically to access chatgpt.com. Meanwhile, all other applications (Safari, Teams, Outlook, etc.) should continue using the Wi-Fi connection to conserve hotspot data.

Request: Could you please provide step-by-step instructions on how to set up this configuration?

Lateral Thinking: I'm flexible to use any browser as long as chatgpt is accessible or even a different strategy altogether, Whatever is the easiest route to get the job done.


It's Not a Duplicate: The suggested answer mentions VPN etc. I don't have a VPN. I have two independent internet connections (Ethernet and WiFi)

Say your default gateway is 1.2.3.4 and you have a vpn which can route traffic on 6.7.8.9. If you want your mail traffic to route over 6.7.8.9, just do

Giacomo1968
  • 58,727
Source
  • 121

1 Answers1

0

In ordinary terms, you cannot do this.

IP routing works at the network level, not the application level. In other words, it is possible to configure the OS to send all traffic for ChatGPT.com via en1 vs en0, but it is not possible to say 'send CHROME traffic through en1 and SAFARI traffic through en0'.

(the above is not withstanding things like proxy server configs where the application has its own controls for network access)

Anyway, to do this you need to know the gateway address attached to each of the interfaces on your system You can get this via System Preferences -> Network, or via the command line:

netstat -rn | grep default

default 192.168.2.254 UGScg en7
default 192.168.1.254 UGScIg en0

Here you can see I have two interfaces configured (en7 and en0), with different gateway addresses for each (192.168.1.254 and 192.168.2.254)

Next you need to determine the destination IP address you're trying to reach. dig or host is probably your friend here:

host chatgpt.com

chatgpt.com has address 172.64.155.209

Now you can add a route to your system's routing table telling it that to get to that IP address it should use the gateway address of your secondary interface:

sudo route add -host 172.64.155.209 192.168.2.254

Now the OS will send any traffic for 172.64.155.209 through the router at 192.168.2.254 instead of your default.