Score:0

ping works but internet connection times out [Ubuntu 22.04, ethernet connection]

co flag

I am currently connected to the internet through ethernet. However, I am not able to connect to the internet. On running the command

sudo apt-get update

I get

Cannot initiate the connection to security.Ubuntu.com:80 (2001:67c:1562::18)

I have tried the following operations:

nmcli n on

I have tried the operations in this link.

I have pretty much tried everything on stack exchange (changed /etc/resolv.conf and added nameserver 8.8.8.8).

I am able to ping any server, with 100 % packet transmission and 100 % packet received.

I cannot run ifconfig -a because it is not installed and I am unable to install it because of the same error that I get with sudo apt-get update.

Any help will be appreciated

mpboden avatar
do flag
Don’t edit `/etc/resolv.conf`. By default it is a symlink to the local caching stub resolver: `/run/systemd/resolve/stub-resolv.conf`. Please update your question with the output of `ls -l /etc/resolv.conf` and `resolvectl status` and `ip a`.
Score:0
br flag

Your computer is trying to connect to a server at an IPv6 address. I assume you are trying to ping servers that are responding from an IPv4 address.

Diagnosis

For a more detailed diagnosis I would need to see the response to commands:

ip addr

ip neigh

ip route

ip -6 route

ping 8.8.8.8

ping6 2001:4860:4860::8888

traceroute 8.8.8.8

traceroute 2001:4860:4860::8888

dig -t a dns.google

dig -t aaaa dns.google

dig -t aaaa dns.google @2001:4860:4860::8888

nc -4zv www.google.com 80

nc -6zv www.google.com 80

The traceroute can be installed by

apt update
apt install traceroute

The netcat nc can be installed by

apt update
apt install netcat-openbsd

Since your update is not working, you may not be able to install the traceroute and netcat-openbsd packages. Therefore, I present a solution to the probable glitch.

Probable cause

The likely cause is that your computer does not have the IPv6 interface set up correctly, or you do not have an IPv6 Internet connection available from your LAN.

Suggested solution

Disable IPv6 on your computer, restart the network interface, or rather reboot the entire computer, and try the connection to the server again.

Temporarily disabling of the IPv6

Does not require a reboot, works immediately without further action.

echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6

Re-enable:

echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6

Permanently disabling of the IPv6

Requires a reboot. Change is made by editing the config file /etc/sysctl.conf e.g.

sudo vi /etc/sysctl.conf

Then add the lines to the end of the file:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Save, reboot the machine.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.