Ping Test Cellular Modems
Overview
When performing ICMP ping tests over cellular networks, IPv6 is recommended over IPv4 due to how mobile carriers handle network address translation.
The Problem: CGNAT Blocks IPv4 ICMP
What is CGNAT?
CGNAT (Carrier-Grade NAT) is a technique used by mobile carriers to conserve IPv4 addresses. Instead of assigning each device a unique public IPv4 address, the carrier places thousands of customers behind a single shared public IP.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Your Modem │ │ Carrier NAT │ │ Internet │
│ │ │ │ │ │
│ 192.0.0.2 │─────►│ 92.184.x.x │─────►│ 8.8.8.8 │
│ (private IP) │ │ (shared IP) │ │ (Google DNS) │
└─────────────────┘ └─────────────────┘ └─────────────────┘Why IPv4 ICMP Fails
| Protocol | Port-based? | NAT Tracking | Result |
|---|---|---|---|
| TCP (HTTP) | Yes | Easy - uses ports | Works |
| UDP (DNS) | Yes | Easy - uses ports | Works |
| ICMP (Ping) | No | Difficult - no ports | Often blocked |
ICMP packets don't have port numbers, making it difficult for the NAT gateway to route replies back to the correct customer. Many carriers simply block ICMP or don't properly route the replies.
Symptoms:
ping 8.8.8.8returns 100% packet losscurl http://example.comworks fine- Modem shows "connected" but ping fails
The Solution: Use IPv6
Why IPv6 Works
With IPv6, your modem receives a globally routable public address - no NAT required.
┌─────────────────┐ ┌─────────────────┐
│ Your Modem │ │ Internet │
│ │◄────────────────────────────►│ │
│ 2a01:cb06:... │ Direct connection │ 2001:4860:... │
│ (public IP) │ No NAT translation │ (Google DNS) │
└─────────────────┘ └─────────────────┘| Aspect | IPv4 + CGNAT | IPv6 |
|---|---|---|
| Address type | Private (192.0.0.x) | Public (2a01:...) |
| NAT required | Yes | No |
| ICMP routing | Problematic | Direct |
| Ping reliability | Often fails | Works reliably |
Proof
# IPv4 ping - FAILS (CGNAT blocks ICMP)
$ ping -I wwan0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 192.0.0.2 wwan0: 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss
# IPv6 ping - WORKS (direct public address)
$ ping -I wwan0 2001:4860:4860::8888
PING 2001:4860:4860::8888 from 2a01:cb06:... wwan0: 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=113 time=45.9 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=113 time=31.9 ms
--- 2001:4860:4860::8888 ping statistics ---
2 packets transmitted, 2 received, 0% packet lossRecommended Ping Targets
IPv6 (Recommended)
| Target | Address | Provider |
|---|---|---|
| Google DNS (primary) | 2001:4860:4860::8888 | |
| Google DNS (secondary) | 2001:4860:4860::8844 | |
| Cloudflare DNS (primary) | 2606:4700:4700::1111 | Cloudflare |
| Cloudflare DNS (secondary) | 2606:4700:4700::1001 | Cloudflare |
IPv4 (May fail on CGNAT)
| Target | Address | Provider |
|---|---|---|
| Google DNS (primary) | 8.8.8.8 | |
| Google DNS (secondary) | 8.8.4.4 | |
| Cloudflare DNS (primary) | 1.1.1.1 | Cloudflare |
| Cloudflare DNS (secondary) | 1.0.0.1 | Cloudflare |
Troubleshooting
Check Your IP Version
# Check assigned IPs on modem interface
ip addr show wwan0
# Example output:
# inet 192.0.0.2/27 <- IPv4 (private, behind CGNAT)
# inet6 2a01:cb06:.../64 <- IPv6 (public, no NAT)Verify IPv6 Connectivity
# Test IPv6 ping
ping6 2001:4860:4860::8888
# Test IPv6 HTTP
curl -6 http://ifconfig.meCommon Issues
| Issue | Cause | Solution |
|---|---|---|
| IPv4 ping fails, IPv6 works | CGNAT blocking ICMP | Use IPv6 targets |
| Both fail | No signal / not registered | Check mmcli -m 0 status |
| IPv6 not available | Carrier doesn't support | Fall back to TCP-based tests |
Summary
| Recommendation | Reason |
|---|---|
| Use IPv6 for ping tests | Avoids CGNAT ICMP blocking |
Default to 2001:4860:4860::8888 | Reliable, widely available |
For network performance testing over cellular connections, always prefer IPv6 to ensure reliable ICMP ping measurements.