[Solved]Can't access couple of websites from OpenWrt

Well I assigned a static IP address in my phone's WiFi and then enabled USB debugging and proceeded to ADB shell and did a ping to twitter.com and other websites to see a difference.

I must say that ping takes a lot of time to show the results, even the first one. I am not really sure why the ping is at 444ms when it almost took 4-5 seconds to display the first response (only for twitter). There's no traceroute command available so I cant traceroute from the android OS. I also did the ping with time command just in case.

PL2_sprout:/ $ time ping -c 5 openwrt.org
PING openwrt.org (139.59.209.225) 56(84) bytes of data.
64 bytes from wiki-01.infra.openwrt.org (139.59.209.225): icmp_seq=1 ttl=251 time=403 ms
64 bytes from wiki-01.infra.openwrt.org (139.59.209.225): icmp_seq=2 ttl=251 time=426 ms
64 bytes from wiki-01.infra.openwrt.org (139.59.209.225): icmp_seq=3 ttl=251 time=448 ms
64 bytes from wiki-01.infra.openwrt.org (139.59.209.225): icmp_seq=4 ttl=251 time=368 ms
64 bytes from wiki-01.infra.openwrt.org (139.59.209.225): icmp_seq=5 ttl=251 time=390 ms

--- openwrt.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 368.367/407.556/448.309/27.801 ms
    0m04.64s real     0m00.01s user     0m00.03s system
PL2_sprout:/ $ time ping -c 5 google.com
PING google.com (172.217.18.142) 56(84) bytes of data.
64 bytes from arn02s05-in-f142.1e100.net (172.217.18.142): icmp_seq=1 ttl=251 time=139 ms
64 bytes from arn02s05-in-f142.1e100.net (172.217.18.142): icmp_seq=2 ttl=251 time=160 ms
64 bytes from arn02s05-in-f142.1e100.net (172.217.18.142): icmp_seq=3 ttl=251 time=180 ms
64 bytes from arn02s05-in-f142.1e100.net (172.217.18.142): icmp_seq=4 ttl=251 time=87.7 ms
64 bytes from arn02s05-in-f142.1e100.net (172.217.18.142): icmp_seq=5 ttl=251 time=119 ms

--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4012ms
rtt min/avg/max/mdev = 87.704/137.476/180.500/32.163 ms
    0m04.17s real     0m00.02s user     0m00.01s system
PL2_sprout:/ $ time ping -c 5 twitter.com
PING twitter.com (104.244.42.65) 56(84) bytes of data.
64 bytes from 104.244.42.65: icmp_seq=1 ttl=251 time=444 ms
64 bytes from 104.244.42.65: icmp_seq=2 ttl=251 time=356 ms
64 bytes from 104.244.42.65: icmp_seq=3 ttl=251 time=395 ms
64 bytes from 104.244.42.65: icmp_seq=4 ttl=251 time=426 ms
64 bytes from 104.244.42.65: icmp_seq=5 ttl=251 time=424 ms

--- twitter.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 41696ms
rtt min/avg/max/mdev = 356.133/409.355/444.470/30.934 ms
    0m42.73s real     0m00.02s user     0m00.02s system
PL2_sprout:/ $ time ping -c 5 microsoft.com
PING microsoft.com (40.113.200.201) 56(84) bytes of data.

--- microsoft.com ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4016ms

    0m14.19s real     0m00.00s user     0m00.03s system
1|PL2_sprout:/ $ time ping -c 5 microsoft.com
PING microsoft.com (40.113.200.201) 56(84) bytes of data.

--- microsoft.com ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4007ms

    0m14.04s real     0m00.02s user     0m00.02s system
1|PL2_sprout:/ $ time ping -c 5 yahoo.com
PING yahoo.com (72.30.35.9) 56(84) bytes of data.
64 bytes from media-router-fp1.prod1.media.vip.bf1.yahoo.com (72.30.35.9): icmp_seq=1 ttl=251 time=329 ms
64 bytes from media-router-fp1.prod1.media.vip.bf1.yahoo.com (72.30.35.9): icmp_seq=2 ttl=251 time=351 ms
64 bytes from media-router-fp1.prod1.media.vip.bf1.yahoo.com (72.30.35.9): icmp_seq=3 ttl=251 time=374 ms
64 bytes from media-router-fp1.prod1.media.vip.bf1.yahoo.com (72.30.35.9): icmp_seq=4 ttl=251 time=395 ms

--- yahoo.com ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 4006ms
rtt min/avg/max/mdev = 329.085/362.474/395.243/24.713 ms
    0m05.08s real     0m00.00s user     0m00.04s system
PL2_sprout:/ $ time ping -c 5 speedtest.net
PING speedtest.net (151.101.66.219) 56(84) bytes of data.
64 bytes from 151.101.66.219: icmp_seq=1 ttl=251 time=51.0 ms
64 bytes from 151.101.66.219: icmp_seq=2 ttl=251 time=135 ms
64 bytes from 151.101.66.219: icmp_seq=3 ttl=251 time=66.5 ms
64 bytes from 151.101.66.219: icmp_seq=4 ttl=251 time=68.0 ms
64 bytes from 151.101.66.219: icmp_seq=5 ttl=251 time=67.0 ms

--- speedtest.net ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4010ms
rtt min/avg/max/mdev = 51.023/77.691/135.720/29.690 ms
    0m04.16s real     0m00.02s user     0m00.02s system
PL2_sprout:/ $ time ping -c 5 pakgamers.com
PING pakgamers.com (199.193.119.193) 56(84) bytes of data.
64 bytes from 199-193-119-193.static.hvvc.us (199.193.119.193): icmp_seq=1 ttl=251 time=433 ms
64 bytes from 199-193-119-193.static.hvvc.us (199.193.119.193): icmp_seq=2 ttl=251 time=355 ms
64 bytes from 199-193-119-193.static.hvvc.us (199.193.119.193): icmp_seq=3 ttl=251 time=375 ms
64 bytes from 199-193-119-193.static.hvvc.us (199.193.119.193): icmp_seq=4 ttl=251 time=397 ms
64 bytes from 199-193-119-193.static.hvvc.us (199.193.119.193): icmp_seq=5 ttl=251 time=421 ms

--- pakgamers.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 355.144/396.832/433.876/28.898 ms
    0m04.52s real     0m00.03s user     0m00.01s system
PL2_sprout:/ $ time ping -c 5 curiouscat.com
PING curiouscat.com (69.164.195.18) 56(84) bytes of data.
64 bytes from li110-18.members.linode.com (69.164.195.18): icmp_seq=1 ttl=251 time=303 ms
64 bytes from li110-18.members.linode.com (69.164.195.18): icmp_seq=2 ttl=251 time=337 ms
64 bytes from li110-18.members.linode.com (69.164.195.18): icmp_seq=3 ttl=251 time=347 ms
64 bytes from li110-18.members.linode.com (69.164.195.18): icmp_seq=4 ttl=251 time=371 ms
64 bytes from li110-18.members.linode.com (69.164.195.18): icmp_seq=5 ttl=251 time=396 ms

--- curiouscat.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4003ms
rtt min/avg/max/mdev = 303.954/351.389/396.055/31.102 ms
    0m04.97s real     0m00.03s user     0m00.01s system
PL2_sprout:/ $ time ping -c 5 youtube.com
PING youtube.com (216.58.210.78) 56(84) bytes of data.
64 bytes from mct01s06-in-f78.1e100.net (216.58.210.78): icmp_seq=1 ttl=251 time=108 ms
64 bytes from mct01s06-in-f78.1e100.net (216.58.210.78): icmp_seq=2 ttl=251 time=198 ms
64 bytes from mct01s06-in-f78.1e100.net (216.58.210.78): icmp_seq=3 ttl=251 time=115 ms
64 bytes from mct01s06-in-f78.1e100.net (216.58.210.78): icmp_seq=4 ttl=251 time=136 ms
64 bytes from mct01s06-in-f78.1e100.net (216.58.210.78): icmp_seq=5 ttl=251 time=156 ms

--- youtube.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4011ms
rtt min/avg/max/mdev = 108.557/142.954/198.115/32.221 ms
    0m04.25s real     0m00.02s user     0m00.01s system
PL2_sprout:/ $ time ping -c 5 google.com
PING google.com (172.217.18.142) 56(84) bytes of data.
64 bytes from arn02s05-in-f142.1e100.net (172.217.18.142): icmp_seq=1 ttl=251 time=85.3 ms
64 bytes from arn02s05-in-f142.1e100.net (172.217.18.142): icmp_seq=2 ttl=251 time=111 ms
64 bytes from arn02s05-in-f142.1e100.net (172.217.18.142): icmp_seq=3 ttl=251 time=132 ms
64 bytes from arn02s05-in-f142.1e100.net (172.217.18.142): icmp_seq=4 ttl=251 time=155 ms
64 bytes from arn02s05-in-f142.1e100.net (172.217.18.142): icmp_seq=5 ttl=251 time=175 ms

--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4011ms
rtt min/avg/max/mdev = 85.372/131.984/175.241/31.676 ms
    0m04.28s real     0m00.00s user     0m00.03s system

Edit: I think the above ping tests properly show the behavior of twitter on my phone. It keeps trying to receive response but fails to do so. As you can also see most of the URLs get translated to some servers but twitter fails to do so. I don't know if this can be fixed because I have already reset my phone a couple of times because of the issue.

1 Like

Fwiw I noticed that there's an offer to "try the new twitter" on my desktop twitter page a week or so ago so it looks like they're changing it up and the problems you're seeing might just be an artifact of whatever they're doing, just a guess though. And I have an old 3rd gen iPad from 2012 and while the official twitter app works fine on it, trying to load twitter in safari just freezes everything up, sounds similar to the problem you're having.

1 Like

This is definitely not ok, it's like you are using Satellite/2G.

1 Like

Well I am using ADSL2+ 8mb/1mb but I think you maybe right, I am a user at a forum related to my ISP and everyone seems to be having problems with their routing, with huge spikes of pings. I am guessing that on my phone the pings are too high and that is why the twitter app kinds of times out while trying to get a response. I am gonna talk to my ISP tomorrow again and see what they have to say about this.

No my problem is not like that, I can not access twitter entirely from my phone whether browser or twitter app (official). But I can access twitter if I use a third party app on phone.

1 Like

If you want to test the theory you could take the router to a friend who is subscribed with another ISP (unless both ISPs routing share the problem).

opkg update
opkg install mtr
mtr -wbc10 openwrt.org
1 Like

So I've been told that my ADSL line is as shitty as it can get. No wonder why I am not able to connect through OpenWrt dsl. But anyway I am using the ISP router for internet with DMZ enabled so all the traffic passes through to OpenWrt router. Even if I am connected in double NAT situation I still get twitter working on my phone and it's working now. I've asked them to upgrade me to VDSL so let's see how that goes.

Anyway, what is mtr? And how this is going to help here?

As I said before it only happens with OpenWrt router, no matter which one I choose and I have 3 of them. Also everything works fine if I use it in double NAT situation and OpenWrt router is just passing the data. But as soon as it is initiated by OpenWrt it starts to not work. Plus those users are complaining about high pings and although it's the case for me I can live with that providing I can access websites on my whole network.

1 Like

Alright this is what it did:

root@AhmarRouter:~# mtr -wbc10 openwrt.org
Start: Tue Feb 19 17:33:31 2019
HOST: AhmarRouter                                                  Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 182.176.1.48 (182.176.1.48)                                 0.0%    10   34.6  24.9  20.7  38.9   6.5
  2.|-- 10.0.3.145 (10.0.3.145)                                     0.0%    10   23.0  22.3  21.9  23.0   0.0
  3.|-- 182.184.3.153 (182.184.3.153)                               0.0%    10   35.7  36.3  35.1  39.8   1.2
  4.|-- 10.0.4.50 (10.0.4.50)                                       0.0%    10   35.0  36.5  34.7  49.4   4.5
  5.|-- static-10GE-KHI275-P01-SwA.pie.net.pk (202.125.128.173)     0.0%    10   37.0  38.0  36.1  39.2   0.7
  6.|-- rwp44.pie.net.pk (221.120.248.45)                           0.0%    10   37.3  39.8  37.3  41.3   1.3
  7.|-- te0-7-0-7.ccr21.mrs01.atlas.cogentco.com (149.14.126.9)     0.0%    10  129.8 129.7 129.3 131.1   0.3
  8.|-- 130.117.15.62 (130.117.15.62)                               0.0%    10  150.6 150.5 150.4 150.6   0.0
  9.|-- ae-10.r24.frnkge08.de.bb.gin.ntt.net (129.250.4.71)         0.0%    10  166.1 166.2 165.2 167.3   0.3
 10.|-- ae-1.r04.frnkge08.de.bb.gin.ntt.net (129.250.3.218)         0.0%    10  170.0 169.8 169.4 170.3   0.0
 11.|-- ce-0-7-0-3.r04.frnkge08.de.ce.gin.ntt.net (168.143.229.54)  0.0%    10  301.3 302.1 301.1 304.6   0.9
 12.|-- ???                                                        100.0    10    0.0   0.0   0.0   0.0   0.0
 13.|-- wiki-01.infra.openwrt.org (139.59.209.225)                  0.0%    10  290.8 291.1 290.8 292.0   0.0
root@AhmarRouter:~# mtr -wbc10 twitter.com
Start: Tue Feb 19 17:34:06 2019
HOST: AhmarRouter                                                      Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 182.176.1.48 (182.176.1.48)                                    10.0%    10   21.6  21.8  21.1  23.7   0.5
  2.|-- 182.184.9.34 (182.184.9.34)                                     0.0%    10   23.3  30.2  22.7  42.7   7.5
  3.|-- 182.184.3.149 (182.184.3.149)                                   0.0%    10   36.7  37.7  34.6  50.0   4.4
  4.|-- 10.0.4.90 (10.0.4.90)                                           0.0%    10   34.4  37.2  34.0  52.2   5.7
  5.|-- static-10GE-KHI494-P01-KHI494-SWA.pie.net.pk (202.125.128.174)  0.0%    10   38.0  39.4  37.7  43.3   1.5
  6.|-- static.khi77.pie.net.pk (202.125.128.151)                       0.0%    10   36.0  42.7  35.7  61.1   9.4
  7.|-- te0-4-0-27.ccr21.mrs01.atlas.cogentco.com (149.14.126.1)        0.0%    10  130.5 131.8 130.1 136.5   1.9
  8.|-- pccw.mrs01.atlas.cogentco.com (130.117.14.62)                   0.0%    10  174.1 168.5 166.7 174.1   2.0
  9.|-- TenGE0-1-0-6.br02.frf06.pccwbtn.net (63.218.232.53)             0.0%    10  167.7 169.6 167.5 179.2   3.7
 10.|-- Twitter.BE2.br02.frf06.pccwbtn.net (63.218.233.70)              0.0%    10  292.1 297.3 292.1 318.2   8.9
 11.|-- 104.244.42.193 (104.244.42.193)                                 0.0%    10  296.3 296.4 287.5 319.9   9.5

1 Like

Now we can see the routers, which produce the most delay.
You can perform this test from any of your clients to make sure your router is not involved in the issue.
It's even possible that in your case setting up a VPN-client service on the router would reduce the RTT.

1 Like

So if I get the same results on my laptop then the router is all fine. But unfortunately I cant do this on my phone since there's no mtr package.

1 Like

There shouldn't be much difference from which client to test.
However you can use tracepath in Termux for Android:

pkg install tracepath
tracepath openwrt.org

As a matter of fact, there is traceping in Google Play.

1 Like

Thank you for the app. But here is something, at start there are lost pings but as it keeps trying there are no lost pings afterwards.



As you can see at start there are more errors but then it starts to respond.

1 Like

I would say that it is not so terrible, but having packet loss at your router is worrying and you could start investing from there.
You are not applying any rate limit, are you?
Run a ping for 1000 packets and see how much is the loss.

2 Likes

First I am not applying any rate limit, just using SQM but even without SQM it's same thing.
Secondly the packet loss is not consistent, sometimes there's no response for 80 packets in one go. I have seen it in traceping, the packet loss is unusal sometimes and there's not really a pattern. Sometimes it keeps working for a while and then a massive packet loss.
I have also noticed some dropped traffic in firewall but I don't really know if it's related to this because it was just a few kbs maybe 250 or so.

So I would like to see if firewall or iptables cause this issue somewhere. How can I disable firewall and iptables rules and still access internet? Because if I stop firewall there's no internet connectivity anymore.

Edit: I have tested with different websites and except twitter every website has only around 1,2% of packet loss but with twitter it's around 10-50%.

iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o WAN_INTERFACE_NAME -j MASQUERADE
1 Like

Actually, service firewall stop invokes fw3 flush, which clears the tables regardless of whether the firewall service is running or not.

2 Likes

It doesn't work for me.

root@xeli:~# service firewall stop
-ash: service: not found

I could to stop it with

/etc/init.d/firewall stop

Nonetheless, he will need the last MASQ command to enable internet in the lan.

1 Like

5 posts were split to a new topic: Service command not found