Linux – Yum fails with [Errno 4] IOError: but TCP traceroute works

linuxnetworkingroutingyum

When I try to connect to yum repos using either yum info or yum install I get the error: [Errno 4] IOError: <urlopen error (111, 'Connection refused')> I first thought our Firewall may be to blame, but traceroute -T -p 80 dl.fedoraproject.org completes successfully, however wget http://dl.fedoraproject.org/pub/epel/5/i386/repodata/repomd.xml fails with connection refused. I am a bit confused here. What could account for this behavior? This is a RHEL 5 box which I didn't setup and rarely access. DNS is resolving fine, no static routes in the routing table, no proxy on the server that I can see.

Best Answer

traceroute -T doesn't do what you seem to think it does. It uses a TCP SYN packet to probe for the existence of a device. Success in this means that it got some sort of response. It is likely it did get a response: connection refused.

Here's the Fine Manual:

   This  method  uses well-known "half-open technique", which prevents applications on
   the destination host from seeing our probes at all.  Normally, a tcp syn  is  sent.
   For  non-listened ports we receive tcp reset, and all is done. For active listening
   ports we receive tcp syn+ack, but answer by tcp  reset  (instead  of  expected  tcp
   ack),  this way the remote tcp session is dropped even without the application ever
   taking notice.