0

Under Ubuntu, I created a Centos 8 LXD container:

lxc launch images:centos/8 centoscontainer

Then, I log into the container with lxc exec centoscontainer /bin/bash.

I'm root, and I can access network just fine:

# ping mirrorlist.centos.org
PING mirrorlist.centos.org (147.75.69.225) 56(84) bytes of data.
64 bytes from packet04.centos.org (147.75.69.225): icmp_seq=1 ttl=43 time=213 ms
64 bytes from packet04.centos.org (147.75.69.225): icmp_seq=2 ttl=43 time=209 ms
64 bytes from packet04.centos.org (147.75.69.225): icmp_seq=3 ttl=43 time=206 ms
^C

But when I try to use yum install, it fails, and I don't understand why:

# yum install -y java-1.8.0-openjdk-devel
CentOS Linux 8 - BaseOS                                                                                                                                                                               0.0  B/s |   0  B     05:59    
Errors during downloading metadata for repository 'baseos':
  - Curl error (7): Couldn't connect to server for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=BaseOS&infra=stock [Failed to connect to mirrorlist.centos.org port 80: Connection timed out]
Error: Failed to download metadata for repo 'baseos': Cannot prepare internal mirrorlist: Curl error (7): Couldn't connect to server for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=BaseOS&infra=stock [Failed to connect to mirrorlist.centos.org port 80: Connection timed out]

What is the way to troubleshoot this ?

alci
  • 137
  • 1
  • 10
  • 1
    Try to telnet to mirrorlist.centos.org over Port 80 ; That may report "Connection timed out" ; Your config may be blocking Port 80 .... Similar Problem with Solution here :: https://discuss.linuxcontainers.org/t/problems-accessing-http-s-from-container-with-ports-80-and-443-forwarded/5702 ; That may help you .... – Prem Jan 19 '22 at 18:35
  • Can't telnet as telnet is not installed (and I can't yum)... That said, maybe I can try to get the rpm and localinstall it. – alci Jan 19 '22 at 19:24
  • Ok, install telnet with yum localinstall --disablerepo=* telnet-0.17-76.el8.x86_64.rpm (I previously downloaded the rpm and lxc file pushed it to the container). Telnet times out as well. – alci Jan 19 '22 at 19:48
  • 1
    I disabled ufw on the Ubuntu host side, and that solved the problem. Weird thing is the ufw configuration has no rule and says Incoming allowed, outgoing allowed... – alci Jan 19 '22 at 19:50
  • 1
    Nice to know that it is working now. Your config was blocking Port 80 but in some "non-obvious" way. You could list the ufw config rules and add-back one-by-one to check which rule is blocking the access. – Prem Jan 20 '22 at 05:34

0 Answers0