由于OPNsense的软件仓库服务器位于国外(20.75版本以后,增加了国内绍兴镜像站点,https://opnsense.aivian.org),国内用户会经常遇到无法安装的情况。本文以安装zerotier插件为例,介绍在OPNsense上离线安装软件包的方法。
下载软件包及依赖包
在OPNsense国内镜像软件包仓库下载对应版本的软件包,一些共用的依赖包可以在FreeBSD的软件仓库找到。安装zerotier插件需要下载两个文件,一是应用程序文件,一个是系统安装文件(os开头的文件,用于添加菜单并进行相应设置,其他插件根据安装提示可能还需要依赖包),请根据自己的系统版本下载对应的文件。
- zerotier-1.4.6.txz
- os-zerotier-1.3.2_2.txz
上传软件包
使用WINSCP软件,将下载的文件上传到OPNsense后台根目录的/tmp目录下。
执行安装程序
使用Xshell等软件,进入OPNsense的shell环境,进入上传文件所在的目录:
cd /tmp
按照先安装依赖包,再安装应用程序,再安装系统包的顺序进行安装,依次执行以下命令:
pkg install zerotier-1.4.6.txz
pkg install os-zerotier-1.3.2_2.txz
遇到如下提示,一律点”y”
Proceed with this action? [y/N]:
第一条命令执行如下所示:
root@OPNsense:/tmp # pkg install zerotier-1.4.6.txz Updating OPNsense repository catalogue... OPNsense repository is up to date. Updating SunnyValley repository catalogue... SunnyValley repository is up to date. All repositories are up to date. Checking integrity... done (0 conflicting) The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: zerotier: 1.4.6 [unknown-repository] Number of packages to be installed: 1 The process will require 2 MiB more space.Proceed with this action? [y/N]: y[1/1] Installing zerotier-1.4.6... Extracting zerotier-1.4.6: 100% ===== Message from zerotier-1.4.6: -- Note that ZeroTier 1.4.6+ has a *new* license prohibiting commercial SaaS style usage, as well as excluding government organisations. Read the license details carefully to ensure your compliance. First start the zerotier service: service zerotier start To connect to a zerotier network: zerotier-cli join <network> If you are running other daemons or require firewall rules to depend on zerotier interfaces being available at startup, you may need to enable the following sysctl in /etc/sysctl.conf: net.link.tap.up_on_open=1 This avoids a race condition where zerotier interfaces are created, but not up, prior to firewalls and services trying to use them. You can place optional configuration in /var/db/zerotier-one/local.conf as required, see documentation at https://www.zerotier.com/manual.shtml If your system boots from DHCP (such as a laptop), there is a new rc.conf flag that will require that system startup will wait until the zerotier network is established before proceeding. Note that this flag *does not* work for systems confgured with statically assigned IP addresses, and these will hang indefinitely due to an irreducible loop in rc(8) startup files. This flag is disabled by default.
第二条命令执行如下:
root@OPNsense:/tmp # pkg install os-zerotier-1.3.2_2.txzUpdating OPNsense repository catalogue... OPNsense repository is up to date. Updating SunnyValley repository catalogue... SunnyValley repository is up to date. All repositories are up to date. Checking integrity... done (0 conflicting) The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: os-zerotier: 1.3.2_2 [unknown-repository] Number of packages to be installed: 1Proceed with this action? [y/N]: y[1/1] Installing os-zerotier-1.3.2_2... Extracting os-zerotier-1.3.2_2: 100% Stopping configd...done Starting configd. Keep version OPNsense\Zerotier\Zerotier (1.3.0) Reloading plugin configuration Configuring system logging...done. Reloading template OPNsense/zerotier: OK
至此,软件包安装完毕。
运行软件包
导航到***>zerotier,就可以进行各项设置了。
删除软件包
与pfSense不同,这种方式安装的软件包,在系统>插件处可以卸载。当然也可以在shell下,使用以下命令手动删除:
pkg remove zerotier
命令执行如下所示:
root@OPNsense:/tmp # pkg remove zerotierChecking integrity... done (0 conflicting) Deinstallation has been requested for the following 2 packages (of 0 packag es in the universe): Installed packages to be REMOVED: os-zerotier: 1.3.2_2 zerotier: 1.4.6 Number of packages to be removed: 2 The operation will free 2 MiB. Proceed with deinstalling packages? [y/N]: y [1/2] Deinstalling os-zerotier-1.3.2_2... [1/2] Deleting files for os-zerotier-1.3.2_2: 100% Reloading plugin configuration [2/2] Deinstalling zerotier-1.4.6... [2/2] Deleting files for zerotier-1.4.6: 100%
安装其他下线软件包
在20.75版本中,已不再提供pptp和L2TP插件的安装,通过本文介绍的方法,可以继续安装这两个插件。
去国内的镜像站点,转到Index of /FreeBSD:11:amd64/20.1/latest/All/目录,找到os-pptp-1.9.txz和os-l2tp-1.9.txz,按照上文件介绍的方法安装即可。
相关文章:pfSense离线安装软件包