Posts Tagged ‘freebsd’

make buildworld & HP ProLiant DL360 Gen10

Tuesday, December 25th, 2018

Upgrade from 11.2-RELEASE to 12.0-RELEASE-p1

Brand: HP ProLiant DL360 G10

Processor: 1 x Intel Xeon Gold 5122 3.60 GHz (4 cores)
Memory: 64GB
HDD: 2 x 600GB (15k RPM, 12Gbps SAS 2.5-inch) in RAID1

Softupdates: ON

CPU: Intel(R) Xeon(R) Gold 5122 CPU @ 3.60GHz (3591.68-MHz K8-class CPU)
real memory  = 68719476736 (65536 MB)
avail memory = 66375839744 (63300 MB)
da0 at smartpqi0 bus 0 scbus0 target 0 lun 0
da0:  Fixed Direct Access SPC-3 SCSI device
da0: 1200.000MB/s transfers
da0: Command Queueing enabled
da0: 572293MB (1172058032 512 byte sectors)

make -j4 buildworld: 52m 18s
make -j4 buildkernel: 3m 22s
make installkernel: 9s
make installworld: 2m 58s

make buildworld & HP ProLiant BL460c G7

Saturday, November 11th, 2017

Upgrade from 11.1-RELEASE to 11.1-RELEASE-p3

Brand: HP ProLiant BL460c G7

I wasn’t able to make it boot from the iLO virtual CD/USB interface no matter what I tried, hence locally attached USB CD-ROM was the only way to install the OS.

Secondly, no network adapters will be recognized after the installation is completed. Therefore, make sure you include src from the system components window, so you can rebuild the kernel with the following stanza added (GENERIC doesn’t include it):

device oce

Processor: 1 x Intel Xeon L5640 2.27 GHz (6 cores)
Memory: 16GB
HDD: 2 x 300GB (10k RPM, 6Gbps SAS 2.5-inch) in RAID1

Softupdates: ON

CPU: Intel(R) Xeon(R) CPU L5640 @ 2.27GHz (2266.79-MHz K8-class CPU)
real memory = 17179869184 (16384 MB)
avail memory = 16598376448 (15829 MB)
da0 at ciss0 bus 0 scbus2 target 0 lun 0
da0:  Fixed Direct Access SPC-3 SCSI device
da0: 135.168MB/s transfers
da0: Command Queueing enabled
da0: 286070MB (585871964 512 byte sectors)

make -j4 buildworld: 1h 6m 23s
make -j4 buildkernel: 5m 26s
make installkernel: 19s
make installworld: 3m 12s

Managing ports for multiple FreeBSD servers

Monday, July 31st, 2017

This is a follow up post on how to manage ports for multiple FreeBSD servers. If you’re looking for how to update the operating system itself, have a look at my almost three years old post: Managing multiple FreeBSD servers.

Alright, so what we’re trying to solve is this: multiple VMs running the same (or different) release of FreeBSD, and you’re looking for a way to centralize delivery of packages to your FreeBSD VMs.


make buildworld & IBM x3550 m3

Saturday, June 24th, 2017

Upgrade from 11.0-RELEASE to 11.1-BETA3

Brand: IBM x3550 m3

In order to successfully boot the server make sure to enable legacy support as per this thread.

Processor: 2 x Intel Xeon E5620 2.40GHz (4 cores each)
Memory: 8GB
HDD: 2 x 146GB (10k RPM, 6Gbps SAS 2.5-inch) in RAID1

Softupdates: ON

CPU: Intel(R) Xeon(R) CPU E5620  @ 2.40GHz (2400.13-MHz K8-class CPU)
real memory  = 8589934592 (8192 MB)
avail memory = 8244543488 (7862 MB)
mfi0:  port 0x1000-0x10ff mem 0x97940000-0x97943fff,0x97900000-0x9793ffff irq 16 at device 0.0 on pci11
mfi0: Using MSI
mfi0: Megaraid SAS driver Ver 4.23 
mfi0: FW MaxCmds = 1008, limiting to 128
mfid0: 139236MB (285155328 sectors) RAID volume (no label) is optimal

make -j4 buildworld: 1h 36m 28s
make -j4 buildkernel: 5m 58s
make installkernel: 13s
make installworld: 3m 32s

MySQL cluster using ndbcluster engine under FreeBSD 11

Sunday, January 22nd, 2017


Not to discourage you, but make sure you read and understand MySQL cluster limitations thoroughly prior to start building the cluster. You don’t want to spend time on building the whole thing just to discover at the very end that you hit some hard coded limitation that can’t be resolved. It’s very easy to be trapped into Catch-22 here: some third-party vendor might say “why would we want to adjust our software to overcome MySQL limitations?”, and I’m sure MySQL dev team has had valid reasons to introduce those. So you end up in the middle, and you’re basically stuck.

For example, the vanilla typo3 distribution won’t work with ndbcluster engine out of the box. You hit the Row size limitation almost immediately, and unless you’re willing to spend time to analyze and optimize the structure of the typo3 database you’re blocked. You might be lucky, and it could be just a small change from varchar(2000) to varchar(1000), but you might be not. In addition to that, you’ll most certainly need a separate instance of MySQL with InnoDB or MyISAM, so you can import the DB, dump it, and start feeding it to the ndbcluster engine in batches. All these contribute to the time spent, and during the course of the installation you start considering alternatives, like changing the Operating System, and/or trying Galera for instance, or even switching to PostgreSQL altogether, but we’re not looking for easy paths, are we? :)


NSD and OpenDNSSEC under FreeBSD 10 [Part 5: SafeNet HSM]

Wednesday, May 18th, 2016

This is the fifth part in the series of articles explaining how to run NSD and OpenDNSSEC under FreeBSD 10.

This time we’re going to integrate proper hardware HSM support in our setup — a pair of SafeNet Network HSMs (aka Luna SA).

Here is how our updated installation diagram looks like:


Before we jump into technical details there are a couple of assumptions:

— I assume that HSMs are already configured and partitioned. HSM installation is outside of scope of this guide since it’s a lengthy and pretty time consuming process which has nothing to do with OpenDNSSEC. It also involves a big chunk of work to be done on the access federation field (different teams accessing different partitions with different PEDs or passwords). SafeNet HSM’s documentation is quite solid though, so make sure this part is completed. In our setup, both HSMs run the latest software 6.2.0-15 and there is one partition created on both units called TEST. TEST partition is activated and we’re going to create High Availability group, add both HSMs to the HA group and allow NS-SIGN to access it;

— As you might have noticed, I decided to leave ZSKs to be handled by SoftHSM. One of the things that you’ll have to keep an eye on with network HSMs is the HDD space. The way it works with SafeNet is that you have an appliance with some fixed amount of disk space (let’s say 2MB). Then you create partitions and allocate space out of total amount for each partition (by default it’s equal distribution). So let’s assume we created five partitions 417274 bytes each. Normally, storing a pair of public/private key consumes very little, but with OpenDNSSEC we’re talking about a number of domains each storing a pair of public/private keys for both KSK and ZSK. It’s very important to understand how far you can go, so you’re not surprised after several years when you discover that you run out of space.

Let’s do some basic math: one domain, with both ZSK (1024) and KSK (2048) stored on HSM, will consume 2768 bytes, so with 417274 bytes partition you should be able to handle ~150 domains. However, during ZSK or KSK rollover, another pair will be temporarily created, and although ZSK/KSK rollover shouldn’t happen at the same time and OpenDNSSEC will purge expired keys after the rollover is completed, you’ll have to consider extra 2768 bytes per domain (for a period of time defined in <Purge> stanza in kasp.xml), which leaves you 75 domains. As you can see this isn’t much. That’s why I decided to keep SoftHSM for ZSKs to save some HSM space (which is not cheap to say the least!).

One of the disadvantages of keeping both storage engines is that you’ll have one more dependency to worry about should you consider to upgrade (for example to SoftHSM2), hence the choice is yours. Another option would be to store private keys in HSM and leave public keys aside (<SkipPublicKey/> option under conf.xml), but I’ve read that it’s very much dependent on the HSM provider and could lead to unexpected results. And one more option would be to use <ShareKeys/> under kasp.xml — that way you can share the same key for multiple domains.


FreeBSD template for ManageEngine OpManager

Friday, March 18th, 2016

We use OpManager by ManageEngine to monitor our infrastructure. Most of Linux flavors are already covered by default templates in OpManager. Moreover, you’ll be able to get interface statistics and CPU/RAM utilization of FreeBSD servers with the included UCD SNMP MIBs. The only bit that was missing was the monitoring of partitions for FreeBSD, hence I decided to spend a bit of my time and finally make the template that could be used in OpManager to monitor FreeBSD servers.

It’s confirmed to work with the latest OpManager 11 (build 11600) and FreeBSD 10.x without UCD Net-SNMP installed but only bsnmp with bsnmp-ucd. The reason why bsnmp is simple: bsnmp is light and is part of the base FreeBSD, so you don’t need to install anything and bsnmp-ucd (available under /usr/ports/net-mgmt/bsnmp-ucd) is a module for bsnmpd which implements parts of UCD-SNMP-MIB, while UCD Net-SNMP requires a massive amount of dependencies to be installed.

Once bsnmp-ucd is installed you might want to enable ucd module in /etc/snmpd.config and restart bsnmpd:

# UCD module
begemotSnmpdModulePath."ucd" = "/usr/local/lib/"

So here we go (you can also download it from here, just make sure to change the extension to XML):

Noteworthy sections:

SysOID oid=: this is the FreeBSD system identifier. When you’re going to add a new FreeBSD server the template will be automatically attached based on SysOID.

CPU and RAM sections were copied from the standard Linux template.

DisplayColumn=: . is a list of available partitions (/, /usr, /var, etc.).

Index=: . is a list of IDs of available partitions.

oid=: (.*100/. is used to calculate the percentage of utilization of a particular partition, where . is used space and . is available space.

Hope it helps.

Managing multiple FreeBSD servers

Monday, November 17th, 2014

If you run multiple installations of FreeBSD sooner or later you will face with the issue of how to update them all in the most efficient and centralized way. Building kernel/world for a FreeBSD server with one CPU and couple of GB of RAM will take hours to complete. Fortunately, there is a way to optimize it.


User based access control for Skype with Dante and FreeBSD 10

Saturday, October 4th, 2014

[20170903/ Yet another one. Since I rarely (read never) use Skype to call, I couldn’t spot it immediately, but all calls were actually dropped after 10 seconds. To fix it, you’ll need to open 3478/udp from your LAN to the outside world. More details are here. Confirmed to work with]

[20170512/ Another update. It actually came out that the latest Skype (confirmed with does support socks, however there is an issue with the password length used to authenticate to the socks instance. Anything greater than 5 (five) characters fails. I don’t know whether it’s done deliberately, or there is some bug that’s never going to be fixed, but anyway, the workaround is either to use some generic account with the five-or-less-characters password, or disable socks authentication altogether./20170512]

[20170312/ Somewhere around first week of March 2017 (or end of February), Skype started dropping connections from versions 7.1.32.xx and below. When you try to log in, you’ll be presented with the message about outdated version. I’m not aware about any versions after 7.1.32 that support Socks. Despite of numerous bugs opened Socks functionality was never fixed, therefore the content of this article is no longer valid, and you won’t be able to use Skype with Socks. The configuration option is still there, but no connection attempts to the Socks server are made. Perhaps this is how they promote the usage of Skype Business Server./20170312]

Today we’re going to configure Dante running on FreeBSD 10.0-STABLE to allow Skype connectivity based on username/password stored in Active Directory. The version of Dante being used is 1.4.1 installed from ports and Active Directory is handled by Windows Server 2008 R2.

Note: as at the time of writing, the version of Dante available in FreeBSD ports collection is 1.4.0 and it’s marked as BROKEN because of the bug 192295. Use this patch to install 1.4.1.

Install required software:

% cd /usr/ports/security/pam_ldap && make install clean
% cd /usr/ports/net/dante && make install clean

Create /usr/local/etc/pam.d/sockd file:

auth       required /usr/local/lib/
account    required /usr/local/lib/
password   required /usr/local/lib/

Create /usr/local/etc/ldap.conf file and fix permissions:

base OU=Users,DC=int,DC=domain,DC=org
ldap_version 3
binddn CN=socksd,OU=Users,DC=int,DC=domain,DC=org
bindpw xxxxxxx
pam_filter objectclass=user
pam_login_attribute samaccountname
% chmod 600 /usr/local/etc/ldap.conf

Adjust host, base, binddn and bindpw to reflect your environment.

Modify /usr/local/etc/sockd.conf file:

logoutput: stdout /var/log/dante.log
internal: port = 1080

socksmethod: pam.username none

user.privileged: root
user.unprivileged: nobody
user.libwrap: nobody

client pass {
        from: port 1024-65535 to:
        log: error connect disconnect

socks pass {
        from: to:
        command: connect udpassociate
        socksmethod: pam.username
        log: error connect disconnect iooperation

socks pass {
        from: to:
        command: udpreply
        log: connect error

Modify /etc/rc.conf to start Dante at boot:

# enable dante

Configure Skype to use Socks with proxy authentication and check the logs of Dante:

Oct  4 16:45:44 (1412433944.407661) sockd[482]: info: pass(1): tcp/accept [:
Oct  4 16:45:44 (1412433944.525454) sockd[483]: info: pass(1): udp/udpassociate [: pam.username%usera@
Oct  4 16:45:49 (1412433949.196857) sockd[630]: info: pass(1): tcp/accept [:
Oct  4 16:45:49 (1412433949.378804) sockd[499]: info: pass(1): tcp/connect [: pam.username%usera@ ->
Oct  4 16:45:49 (1412433949.380925) sockd[499]: info: pass(1): tcp/connect -: pam.username%usera@ -> (35)
Oct  4 16:45:49 (1412433949.544730) sockd[499]: info: pass(1): tcp/connect -: -> pam.username%usera@ (63)
Oct  4 16:45:49 (1412433949.548340) sockd[499]: info: pass(1): tcp/connect -: pam.username%usera@ -> (40)
Oct  4 16:45:49 (1412433949.706747) sockd[499]: info: pass(1): tcp/connect -: -> pam.username%usera@ (3)
Oct  4 16:45:49 (1412433949.962844) sockd[499]: info: pass(1): tcp/connect -: -> pam.username%usera@ (144)

Since Dante is quite talkative make sure to rotate logs by editing /etc/newsyslog.conf file:

/var/log/dante.log                      640  3     100  *     JB    /var/run/

Running Splunk with add-on for Check Point OPSEC LEA on FreeBSD 10

Tuesday, September 30th, 2014

Here is my set of notes to run latest Splunk with add-on for Check Point OPSEC LEA on FreeBSD 10.0-STABLE.

Splunk: 6.1.3 build 220630
Add-on for Check Point OPSEC LEA: 2.1.0
Check Point: R71.30