http://www.perlmonks.org?node_id=251885

astaines has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I've been banging my head against this problem for two days, with no joy, perhaps someone else can help?
I have just installed RedHat 8 on my laptop, which was running Redhat 7.2 very nicely, and CPAN is broken. I did a complete re-install, not an upgrade.

All the components work individually, for example I can get files with ftp and libwww (lwpget) from the CPAN mirrors, but when running the CPAN shell, I can't retrieve any files. Pulling the MIRRORED.BY file over manually allowed me to complete the initial CPAN setup successfully, but I still can't retrieve any files. The LWP access mode just fails with no error message, and the ftp access mode fails at the RETR command, with error 400 and response code 425 from the server

FTP Error- 425
425 Can't build data connection: Connection refused.

This error message is coming from all of the mirror sites in MyConfig.pm. The CPAN shell works fine on the same machine running Windows 2000. All the other internet services seem to be running normally. I use this machine from home over a modem line, so there shouldn't be any odd firewall stuff going on.

Any thoughts?? (Help!!)

--
Anthony Staines

Replies are listed 'Best First'.
Re: Help with CPAN failing
by TVSET (Chaplain) on Apr 20, 2003 at 23:08 UTC
    Looks like a firewall problem. Check your firewall settings on the newly installed RedHat box with:

    [root@host root]# iptatbles -n -L

    If you don't see something like:

    Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination

    then you machine is running a firewall, which might block passive FTP connections. These will require some tuning. For a quick check, you can disable firewall and try to use CPAN shell for some installation. To temporarily switch off the firewall run:

    [root@host root]# service iptables stop

    If you machine is on the protected network and you don't need firewall at all, then you can switch also disable iptables service at boottime by running:

    [root@host root]# chkconfig --level 0123456 iptables off

    HTH.
    perl -e 'print "-- \n Leonid Mamtchenkov\n"'

      Thanks very much - it worked like a charm. I still don't understand why I could use ftp etc, and CPAN couldn't, bt I don't really care either. Thank you very much!

      --
      Anthony Staines