1

I have a raspberry pi running ubuntu server 20 and cannot connect to the internet, but can use ping. This question has been asked by many before, however the solutions provided in those questions do not solve my issue.

I can ping www.ubuntu.com

64 bytes from cactuar.canonical.com (91.189.88.180): icmp_seq=3 ttl=45 time=118 ms

but I cannot use sudo apt update

Could not connect to ports.ubuntu.com:80 (91.189.88.150), connection timed out

I get similar errors when using curl. I have checked my iptables and i dont see anything

Chain INPUT (policy ACCEPT 113 packets, 8043 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 71 packets, 7411 bytes)
 pkts bytes target     prot opt in     out     source               destination

I have UFW disabled (ufw status):

Status: inactive

I set a static IP via netplan and the file is below (cat /etc/netplan/netconf.yaml) and created the /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg file:

network:
  version: 2
  ethernets:
    eth0:
      dhcp4: no
      addresses: [100.65.225.70/24]
      gateway4: 100.65.225.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]

The ouput of ip addr show is:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether b8:27:eb:01:4f:8d brd ff:ff:ff:ff:ff:ff
    inet 100.65.225.70/24 brd 100.65.225.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether b8:27:eb:54:1a:d8 brd ff:ff:ff:ff:ff:ff

I have read that something could be blocking port 80, but I am not seeing anything doing so. Can someone please let me know what else could cause this issue?

  • The indentation appears to be very wrong in the netplan file. Please edit your question to show the result of the terminal command: ip addr show Welcome to Ask Ubuntu. – chili555 May 22 at 21:10
  • @chili555 updated with ip addr show output. The netscan indentation should be ok. If it wasnt I think it would complain when i apply the changes. – Danny May 23 at 0:02
  • @chili555 also updated the netplan file on the machine and the question. – Danny May 23 at 0:23
0

Can you try to download

wget https://cpan.metacpan.org/authors/id/S/SY/SYP/Net-Curl-0.44.tar.gz

Does this download?

Are there any rules in iptables?

ip6tables -nxvL
iptables -nxvL

Are you behind any other external firewall?

| improve this answer | |
  • I cannot download via wget. There were no iptables set by me. When I used dynamic IP I was able to download things but when I went to Static it would not work. – Danny May 23 at 7:35
0

Can you remove all files in /etc/netplan and set a file 00-installer-config.yaml in place.

# network config
network:
  ethernets:
    eth0:
      dhcp4: true
  version: 2

This will enable dhcp and see if wget download is working now. Also would be interesting to see output of

ip addr
| improve this answer | |
  • WHen i reverted back to enable dhcp4 for a dynamic IP I was able to download. – Danny May 23 at 16:19
  • Then it sounds like your router doesn't like letting your traffic through when using an IP not assigned by the dhcp server. – slangasek May 23 at 23:09
  • I think there is a firewall on any other server that is responsible for this 'feature'. – Thomas Aichinger May 24 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.