olehenrikj
Posts: 4
Joined: Thu Nov 30, 2017 3:03 pm

SOLVED: 3G modem connects and ping is working, can't access web.

Tue May 22, 2018 12:03 pm

Hi

As the subject says I have a weird problem with my 3G USB dongle:

I have made it connect with both wvdial/ppp and NetworkManager, I am able to ping with "ppp0" interface to any address, even domains so I know the DNS is working.

I have set the default route after connection:
sudo route add default dev ppp0

If I run curl bound to "ppp0" to any website, it won't receive any data. I tried this:
curl --interface ppp0 https://wtfismyip.com/text

This is to see if I can receive "ppp0" IP-address, but using other web addresses does not work either.

It feels like that most ports are blocked. But it looks like I am able to connect myself to SSH via "ppp0" unless ssh jumps to next available connection automagically.

I run this on a Pi Zero W and I monitor the power usage and everything seems to be fine, using a total of ~20mA while connected.

If anyone know something, please tell me. I have tested this dongle and connection on another computer and I know it works with NetworkManager configured in GUI (so I am pretty sure it should work with CLI as well).

I have also tried Sakis3g, but that didn't connect at all.

Code: Select all

[email protected]*:~ $ ping -I ppp0 google.com
PING google.com (216.58.211.14) from 46.67.61.255 ppp0: 56(84) bytes of data.
64 bytes from arn09s20-in-f14.1e100.net (216.58.211.14): icmp_seq=1 ttl=53 time=386 ms
64 bytes from arn09s20-in-f14.1e100.net (216.58.211.14): icmp_seq=2 ttl=53 time=236 ms
64 bytes from arn09s20-in-f14.1e100.net (216.58.211.14): icmp_seq=3 ttl=53 time=245 ms
64 bytes from arn09s20-in-f14.1e100.net (216.58.211.14): icmp_seq=4 ttl=53 time=245 ms

--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 236.472/278.629/386.414/62.349 ms

Code: Select all

[email protected]*:~ $ curl -S --interface ppp0 https://wtfismyip.com/text
curl: (28) Connection timed out after 300853 milliseconds

Code: Select all

[email protected]*:~ $ ifconfig -a ppp0
ppp0      Link encap:Point-to-Point Protocol  
          inet addr:46.67.61.255  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:61 errors:0 dropped:0 overruns:0 frame:0
          TX packets:63 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:5393 (5.2 KiB)  TX bytes:3817 (3.7 KiB)
The provider is Talkmore which uses telenor APN with pretty basic settings:

Code: Select all

[email protected]*:~ $ nmcli general status
STATE      CONNECTIVITY  WIFI-HW  WIFI     WWAN-HW  WWAN    
connected  full          enabled  enabled  enabled  enabled 

[email protected]*:~ $ nmcli connection show --active
NAME     UUID                                  TYPE     DEVICE  
telenor  88652cff-e305-47f2-87a6-4b88ab4eb5d0  gsm      ttyUSB0 
ppp0     4e91597b-c8ab-419a-a17c-2bf1dbdf4d1d  generic  ppp0    

[email protected]*:~ $ nmcli connection show telenor
connection.id:                          telenor
connection.uuid:                        88652cff-e305-47f2-87a6-4b88ab4eb5d0
connection.interface-name:              --
connection.type:                        gsm
connection.autoconnect:                 no
connection.timestamp:                   1526990151
connection.read-only:                   no
connection.permissions:                 user:pi
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.secondaries:                 
connection.gateway-ping-timeout:        0
ipv4.method:                            auto
ipv4.dns:                               1.1.1.1, 1.0.0.1
ipv4.dns-search:                        apnic.net
ipv4.addresses:                         
ipv4.routes:                            
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv6.method:                            auto
ipv6.dns:                               
ipv6.dns-search:                        
ipv6.addresses:                         
ipv6.routes:                            
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.dhcp-hostname:                     --
gsm.number:                             *99#
gsm.username:                           --
gsm.password:                           --
gsm.password-flags:                     4 (not required)
gsm.apn:                                telenor
gsm.network-id:                         --
gsm.network-type:                       -1
gsm.allowed-bands:                      1 (any)
gsm.pin:                                --
gsm.pin-flags:                          4 (not required)
gsm.home-only:                          no
GENERAL.NAME:                           telenor
GENERAL.UUID:                           88652cff-e305-47f2-87a6-4b88ab4eb5d0
GENERAL.DEVICES:                        ttyUSB0
GENERAL.STATE:                          activated
GENERAL.DEFAULT:                        yes
GENERAL.DEFAULT6:                       yes
GENERAL.VPN:                            no
GENERAL.ZONE:                           --
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/5
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/0
GENERAL.SPEC-OBJECT:                    --
GENERAL.MASTER-PATH:                    --
IP4.ADDRESS[1]:                         ip = 46.67.61.255/32, gw = 10.64.64.64
IP4.DNS[1]:                             193.213.112.4
IP4.DNS[2]:                             130.67.15.198
IP4.DNS[3]:                             1.1.1.1
IP4.DNS[4]:                             1.0.0.1
Last edited by olehenrikj on Wed May 23, 2018 12:10 pm, edited 1 time in total.

epoch1970
Posts: 1840
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: 3G modem connects and ping is working, can't access web.

Tue May 22, 2018 10:17 pm

How does "route -n" look like?
I suspect you have 2 default routes, possibly with the same metric, one via wlan0 one via ppp0.
2 default routes is bad karma under linux.
I suppose wlan0 is used to connect to the LAN or for admin purposes, I would remove this one.
All internet traffic will then go through ppp0, watch your data plan when you apt-get install...
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

olehenrikj
Posts: 4
Joined: Thu Nov 30, 2017 3:03 pm

Re: 3G modem connects and ping is working, can't access web.

Tue May 22, 2018 11:41 pm

epoch1970 wrote:
Tue May 22, 2018 10:17 pm
How does "route -n" look like?
I suspect you have 2 default routes, possibly with the same metric, one via wlan0 one via ppp0.
2 default routes is bad karma under linux.
I suppose wlan0 is used to connect to the LAN or for admin purposes, I would remove this one.
All internet traffic will then go through ppp0, watch your data plan when you apt-get install...
This is my route -n, I tried to remove the wlan0's but only 10.64.64.64 route got removed and still no access to the net, does both need to be removed?

Code: Select all

[email protected]*:~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
0.0.0.0         192.168.0.1     0.0.0.0         UG    302    0        0 wlan0
10.64.64.64     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     0.0.0.0         255.255.255.0   U     302    0        0 wlan0
wlan0 is only used now when configuring the Pi for its purpose, hopefully will get it to work with just the dongle at the end which only need to access a web page.

epoch1970
Posts: 1840
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: 3G modem connects and ping is working, can't access web.

Wed May 23, 2018 7:46 am

Ok, the routing table is correct, ppp0 is used by default when going to the Internet. (It has higher priority: metric 0 vs metric 302 for wlan0)
You can keep wlan0 and ppp0 as they are, you can stop specifying the interface name when using various tools.

I don't see why it doesn't work.
Do you have a firewall setup? Does wwwdial raise a firewall or something like that? Or Talkmore waits for you to pay a bill??
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

olehenrikj
Posts: 4
Joined: Thu Nov 30, 2017 3:03 pm

Re: 3G modem connects and ping is working, can't access web.

Wed May 23, 2018 9:26 am

epoch1970 wrote:
Wed May 23, 2018 7:46 am
Ok, the routing table is correct, ppp0 is used by default when going to the Internet. (It has higher priority: metric 0 vs metric 302 for wlan0)
You can keep wlan0 and ppp0 as they are, you can stop specifying the interface name when using various tools.

I don't see why it doesn't work.
Do you have a firewall setup? Does wwwdial raise a firewall or something like that? Or Talkmore waits for you to pay a bill??
Look at that, you are right. It does work and probably has for some time already.

Reason why I couldn't figure it out is because wlan0 is using IPv6 as well, which override "the main internet" using curl. However, testing with:
curl https://ipv4.wtfismyip.com/text (pure IPv4 version)
It worked as expected!

Thanks anyway for putting me back on the right track!

Return to “General discussion”

Who is online

Users browsing this forum: pagenotfound and 44 guests