Suppose I connect my iPhone (12.4) to a Wi-Fi network and turn on personal hotspot, which requires me to turn on Cellular. Now if I connect the Mac via lightning cable, I see "1 connection" in the blue strip.
How can I check which one of Wi-Fi and mobile data is being shared?
Hint: I use organizational Wi-Fi.
Best Answer
Regardless of how you connect to your iPhone acting a a personal hotspot, whether it be via WiFi or tethered via cable, you are sharing the cellular data connection.
So, using your example, where your iPhone is initially connected to the corporate WiFi and then you enable the Personal Hotspot feature, you will disconnect from the corporate WiFi and a private (NAT) network will be created with a gateway configured through your cellular network. Whether you use WiFi or connect via USB, this network will be created
From Apple Support:
Why is this the case? Your iPhone can only connect to a single WiFi network at any given time. The Personal Hotspot is designed to provide a WiFi signal where you don't have one. This configuration cannot be changed.
Finding your Gateway....
If you want to see which connection you’re using (which has priority) for the Internet you just need to get the IP addresses of you adapters and run a trace route to see the path.
(Values below are from my iMac;
en0
is wired,en1
is WiFi connected to hotspot. Your values will differ.)You will get a output telling you which gateway is being used for Internet traffic. In my case, it's showing me that I'm going through my
en0
or wired network adapter.You could use the
netstat -rn
command to get your default gateway, but I've found that you can have multiple gateways.This is why I like to use
traceroute
to actually (and quickly) "see" where the traffic is going.Measuring Bandwidth....
The only way to measure bandwidth is to use a utility (service) like vnStat. It's available via MacPorts or Homebrew. The system, by default is not measuring bandwidth usage so you'll need a service that gets loaded at boot (or at the users request) to begin logging this data.
A sample output (assuming 2 interfaces) would look like the following:
(with 2 interfaces) $ vnstat