Bulk import DHCPD data into pfSense

Similar to my previous post, if you are trying to bulk import your current DHCPD data into pfSense, the built-in pfSense shell comes in handy.

Here we’ll start to use the current ISC-DHCPD configuration file, /etc/dhcp/dhcpd.conf, which will have entries like this:

Then run the following script – modify it to your needs – which will print out the commands for the pfSense shell. Since my DHCPD configuration is relying upon existing DNS entries and I am having hostnames as “fixed-address” entries, I need to resolve these entries with a dig command. If your file is always using IP addresses, just parse them out:

This will generate the following output, ready to paste into the pfSense shell:

Please keep in mind the index starts at 0, valid for an empty list of host names in your pfSense DHCPD configuration. For each already existing entry you have to add 1 to the starting index of 0.

Posted in Computer | Comments Off on Bulk import DHCPD data into pfSense

Bulk import DNS data into pfSense

If you are trying to bulk import your current DNS data into pfSense, the built-in pfSense shell comes in handy.

First, get your current data into a file with 2 columns like this:

Then run the following script – modify it to your needs – which will print out the commands for the pfSense shell:

This will generate the following output, ready to paste into the pfSense shell:

Please keep in mind the index starts at 0, valid for an empty list of host names in your pfSense Unbound/DNS configuration. For each already existing entry you have to add 1 to the starting index of 0.

Posted in Computer | Comments Off on Bulk import DNS data into pfSense

Sixxs Heartbeat Tunnel without Aiccu but Python (pfSense compatible)

For systems that do not provide Sixxs’ aiccu package to setup a GIF tunnel automatically, you can easily start the tunnel (not setup the routing ­čÖé ) by executing the following script once per minute via cron:

This solution was first posted here:

UBNT – Sixxs Tunnel

Posted in En-Route | Comments Off on Sixxs Heartbeat Tunnel without Aiccu but Python (pfSense compatible)

Output JSON-Code in readable and sorted form so it’s diffable

This code will read in a JSON file and print it out again in readable form and keys in sorted order – making two files diffable!

Usage: jsonsort.py

Posted in En-Route | Comments Off on Output JSON-Code in readable and sorted form so it’s diffable

OpenVPN complains about wrong user/password without you requesting one?

If your OpenVPN client is complaining about a wrong user/password combination (AUTH_FAILED), although you are not requesting it on your server, it might be a completely different reason.

After migrating to a new operating system but taking OpenVPN’s configuration with me, I was running into this problem. All clients were complaining about wrong username and password.

The reason is simple:

I configured OpenVPN to send an email on connect and disconnect of a client. The script wants to use the mail command – which is not installed as default by Xenial. This leads to a client-connect-script error which in turn leads OpenVPN to respond with an AUTH_FAILED. Which in turn gives the “Wrong username/password” error message on the clients.

Solution: Make the client-connect script working again ­čśÇ

Posted in Debian | Comments Off on OpenVPN complains about wrong user/password without you requesting one?

Epic fail: Wo lebt unser Innenmister? Auch in Deutschland?

Zitat aus dem Spiegel:

Maa├čen warnt vor IS-Anschl├Ągen – “Deutsche St├Ądte werden genannt

Der “Islamische Staat” (IS) hat mit seinen Anschl├Ągen auch in Europa f├╝r Angst und Schrecken gesorgt. Jetzt gesteht Verfassungsschutzpr├Ąsident Hans-Georg Maa├čen: Seine Beh├Ârde habe die Terrormiliz zun├Ąchst falsch eingesch├Ątzt. So habe man es zun├Ąchst f├╝r unwahrscheinlich gehalten, dass der IS den Fl├╝chtlingsstrom nutzen werde, um Anh├Ąnger nach Deutschland zu bringen, sagte Maa├čen der “Welt am Sonntag”. “Wir dachten, das Risiko sei schlichtweg viel zu hoch. Mittlerweile wissen wir: Was den IS angeht, m├╝ssen wir eben auch dazulernen.”

Was die Spatzen von den D├Ąchern pfeiffen, hat unser oberster Verfassungssch├╝tzer anscheinend nicht mitbekommen… wozu brauchen wir nochmals noch mehr Daten ├╝ber die B├╝rger, wenn wir schon das Offensichtliche nicht sehen?

EPIC FAIL, Herr Minister!

Posted in Uncategorized | Comments Off on Epic fail: Wo lebt unser Innenmister? Auch in Deutschland?

Installing a Vagrant BaseBox of CentOS

  • Install a minimal system of CentOS in VirtualBox
  • Activate networking on boot by enabling eth0 in
  • Add a vagrant user and assign the password vagrant to it
  • Give sudo rights to that user by adding vagrant ALL=(ALL) NOPASSWD: ALL with visudo
  • Disable requirement of having a TTY by commenting out the following settings with visudo:
  • Add insecure Vagrant public key from https://github.com/mitchellh/vagrant/blob/master/keys/vagrant.pub to vagrant’s authorized_keys
  • Add development tools for building the guest addons with
    The repo options are useful if you want to install from local installation media (ISOs) instead of fetching all from the net.
  • Install guest addons with
  • halt the machine
  • Remove all hardware that is not necessary from the base machine or else it will be available on the machines set up with Vagrant later!
  • Package Box with

Done!

Should Vagrant be unable to connect to your boxes derived from that base box, you might have a problem with SELinux, see here how this can be fixed!

Posted in Computer | Comments Off on Installing a Vagrant BaseBox of CentOS

SSH doesn’t allow logins with keys? SELinux!

If you have correctly setup your authorized_keys and are sure it should allow you logins with keys – then maybe SELinux is giving you a hard time. Especially if your user is not under the normal home directory folder /home. In your /var/log/{auth,secure} files you will see that sshd is not allowed to open authorized_keys and/or authorized_keys2 after you set the “LogLevel DEBUG” in /etc/ssh/sshd_config.

In that case, try to set the correct settings again:

chcon -t ssh_home_t ~PROBLEMATIC_USER/.ssh/
chcon -t ssh_home_t ~PROBLEMATIC_USER/.ssh/authorized_keys

Now everything will work again.

Posted in Computer | Comments Off on SSH doesn’t allow logins with keys? SELinux!

Regenerate public SSH key from an existing private key

Very easy: ssh-keygen -y -e -f private.key

Posted in Computer | Comments Off on Regenerate public SSH key from an existing private key

Charge HP Stream 7 while using it with an OTG cable

After a quite frustrating experience with an HP Stream 7 tablet, which refused to get charged while having a USB stick connected to it via an OTG cable, I found an extremly easy solution:

Just disable the Microsoft AC Power Supply which can be found in the device manager under Batteries.

Voila – that’s it.

I have the German version only where it says Microsoft Ladeger├Ąt and can be found under Akkus.

Posted in Computer | Comments Off on Charge HP Stream 7 while using it with an OTG cable