[solved] slow (first) ping response to internet host

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
benitiv

[solved] slow (first) ping response to internet host

Post by benitiv »

Slow (first)ping response to internet host

Dear Forums,

I have an issue with my Ethernet connection, where the first ping takes a long time until it gets through.

traditional /etc/network/interfaces static IP Address setup:

Code: Select all

auto lo
iface lo inet loopback

# The primary network interface
auto enp8s0
iface enp8s0 inet static
address 192.168.2.85/24
netmask 255.255.255.0
gateway 192.168.2.1
coupled with /etc/resolve.conf

Code: Select all

nameserver 8.8.4.4
nameserver 8.8.8.8
There are no other network programs (network-manager etc.) installed - so there is no interference / overwriting etc.

The Problem:

Code: Select all

ping www.google.com
takes around 5-6 seconds until the first ping goes through, but no anomalies after that.

Here it gets interesting:
In my trial and error research I suspected IP v6 to be the cause, because trying

Code: Select all

ping -4 www.google.com
the first response is practically instant

So I decided to deactivate IP v6 all along:
/etc/sysctl.conf:

Code: Select all

net.ipv6.conf.all.disable_ipv6 = 1
(followed by a sysctl -p)

However, the result is the same. Pinging without the "-4" option results in a 5-6 latency for the first ping, while using "-4" gives the desired result.

How to investigate further?
I also feel like the internet response overall should be a bit snappier that it is atm.

Please help me solving this puzzle.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: slow (first) ping response to internet host

Post by rene »

Is happiness experienced after adding options single-request-reopen to /etc/resolv.conf?
benitiv

Re: slow (first) ping response to internet host

Post by benitiv »

rene wrote: Tue Apr 28, 2020 6:40 am Is happiness experienced after adding options single-request-reopen to /etc/resolv.conf?
Are you a magician?
It seems like that solved it!
Could you please explain or offer a link for explanation?
EDIT1: I found the option in the man pages, but please feel free to provide a more "human readable" explanation or web-source.

Thanks a lot!

EDIT2: I re-enabled ipv6 in the sysctl.conf and everything works as desired. Sorry IPv6 for suspecting you :oops:
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: slow (first) ping response to internet host

Post by rene »

Very good. Don't have much to add to man resolv.conf other perhaps than making explicit that "A requests" refer to IPv4 DNS lookups and AAAA to IPv6 ones. Can not however say to be terribly sure what "some hardware" in that description refers to, i.e., what you could potentially do to not need the option; the only "hardware" that seems relevant here is the hardware that makes up Google's DNS servers, and I just tried those locally and do not experience similarly. So, shrug, I guess. At least it works :)
benitiv

Re: slow (first) ping response to internet host

Post by benitiv »

Yeah the wording "some hardware" is pretty vague.
Thank's a lot for your explanation and help. Really made my new setup complete.

Have a good one.
Locked

Return to “Networking”