This content originally appeared on DEV Community and was authored by François Dautrême
The other day, I faced a frustrating issue while trying to share my iPhone's internet connection with my MacBook. Although I could connect to the hotspot, there was no internet access on my MacBook, despite having a stable connection on my iPhone. It was puzzling.
I tried every basic troubleshooting step I could think of: restarting both devices, toggling the hotspot, and forgetting and reconnecting to the network. None of these worked. The iPhone has limited hotspot settings and even fewer troubleshooting options, leaving me stuck.
Here are some of the troubleshooting options I considered:
- Trying with another MacBook (which I didn’t have)
- Trying with another iPhone (which I didn’t have)
- Trying with another carrier
The last option seemed feasible. I downloaded an eSIM app from the App Store, purchased a data plan from a different carrier, and activated it on my iPhone. Then, I connected my MacBook to the new hotspot. Success! My MacBook had internet access.
However, switching back to my original carrier's data plan caused the connection issue to reappear. I wondered if my carrier was blocking me from sharing my internet connection, but I couldn't see how they would detect it. I reviewed my contract for any clauses about internet sharing—none existed. The carrier's website also lacked information on this matter. A call to customer service resulted in them denying any such restrictions.
Before venting my frustration on social media, I did some research. I discovered that some ISPs block internet sharing by checking the TTL (Time to Live) of the packets. The TTL is a value in an IP packet that determines how many routers the packet can pass through before being dropped, it decrements by one each time the packet passes through a router. If the TTL isn’t set to 64 (or 128 for Windows), the packets are dropped. By default, macOS sets the TTL to 64.
TTL, or Time to Live, is a value in an IP packet that indicates how many hops (transits through routers) the packet is allowed to make before being discarded. This prevents packets from endlessly circulating on the network. Each time a packet passes through a router, its TTL value decreases by one. When the TTL reaches zero, the packet is discarded.
ISPs can detect whether you're sharing your internet connection by examining the TTL value of packets. Typically, a device like your MacBook will send packets with a TTL value of 64. However, when these packets pass through your iPhone (acting as a hotspot), the TTL is reduced by one, arriving at the ISP with a TTL of 63. Some ISPs drop these packets to prevent internet sharing.
To bypass this, you can set the TTL value on your MacBook to 65. This way, when the packets are routed through your iPhone and reach the ISP, the TTL will be 64, making them appear as if they originated directly from your iPhone.
To test this, I decided to change the TTL of the packets on my MacBook to 65. I opened Terminal and ran the following commands:
sudo sysctl -w net.inet.ip.ttl=65
sudo sysctl net.inet6.ip6.hlim=65
It worked instantly! My MacBook gained internet access, confirming that my ISP was indeed blocking me from sharing my connection. Despite this proof, another call to customer service resulted in them hanging up on me when I explained the situation.
Now, everything works perfectly, and I can share my iPhone’s internet connection with my MacBook. Problem solved, and I’m happy.
This is for educational purposes only. Please respect your ISP's terms and conditions. If you encounter a similar issue, contact your ISP for assistance.
This content originally appeared on DEV Community and was authored by François Dautrême
François Dautrême | Sciencx (2024-08-04T07:14:50+00:00) Is your ISP blocking you from sharing your internet connection?. Retrieved from https://www.scien.cx/2024/08/04/is-your-isp-blocking-you-from-sharing-your-internet-connection/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.