Is there some sort of connection I’m missing? I wish I could just configure pkg_add to use HTTP instead of FTP (I have no idea why FreeBSD still uses that sorry excuse for a protocol), but it seems FTP is needed to operate FreeBSDs package system, and I have no idea how to make it work with the firewall. Any suggestions will be welcome :)

Thanks, that works – as for FTP being better at file transfers, I haven’t heard of anything that would make it measurably better than HTTP when doing transfers in the megabyte range…
–
miklAug 2 '10 at 17:09

2 Answers
2

By default FTP uses so called 'Active' mode for data transfer which is not very firewall friendly. In this mode FTP server connects to IP:port specified in PORT command sent by client (82.103.140.25:58627 in your case).

Simplest way to fix this is to switch from 'Active' to 'Passive' FTP transfer mode. In case of 'pkg_add', which uses fetch(1) for file retrieval, it is done by setting environment variable FTP_PASSIVE_MODE.

Ah, that’s a neat trick, thanks. Where is the best place to set such a variable globally (as to avoid having it in .bashrc, .cshrc, etc. for all admin users)?
–
miklAug 4 '10 at 21:21

1

Use /etc/profile for 'sh' and 'bash' or /etc/csh.cshrc and /etc/csh.login for 'csh'. Also, environment can be set through /etc/login.conf. BTW, I've just found that 'default' class in default /etc/login.conf already has FTP_PASSIVE_MODE set.
–
AlexDAug 5 '10 at 3:36