Posts

Showing posts from 2018

IPv4 and IPv6 Reception with rsyslog

Back in the day, when you wanted to change the default protocols rsyslog would listen on, you would modify the /etc/default/rsyslog file, and set the RSYSLOGD_OPTIONS variable accordingly. In rsyslog 8.x, this has changed, now, we control these parameters through the main rsyslog configuration file, and in within the global parameters. For instance, if we wanted to only listen on IPv6, then we would add the following lines to the main rsyslog configuration. # vi /etc/rsyslog.conf global(     net.ipprotocol="ipv4-only" ) Reference:  https://www.rsyslog.com/doc/v8-stable/rainerscript/global.html

Activating OpenVPN in Ubuntu 16.04

Problem Description: In Ubuntu 16.x attempting to restart the OpenVPN service does not activate the configuration in /etc/openvpn and no error logs are generated. Root Cause: In older versions of Ubuntu, simply restarting the openvpn service was enough to activate the configuration in /etc/openvpn, however in Ubuntu 16, this is no longer the case, you must now specify the configuration at the command line. To start the service, we must specify the configuration to use, like so: # systemctl start openvpn@[configurationfile_minus_conf_extension] For instance, if we had a the file /etc/openvpn/acme.conf, to activate this configuration we would issue the following command. # systemctl start openvpn@acme NOTE: In the above command we have removed the .conf extension.

Adding a swap file to Ubuntu 16.x

Recently, I needed to add a swap to a Linux host that didn't have a spare partition, therefore, I was able to use this method to create a swap file, activate, and test it. 1. Create the temporary directory we will use for swap. # mkdir -v /var/cache/swap 2. Create the swap file in the temporary directory (In the example below, we are creating a 500MB swap file, change to suit your needs) # dd if=/dev/zero of=/var/cache/swap/swapfile bs=1M count=500 3. Change the mode of the file so only root can read/write to it # chmod 600 /var/cache/swap/swapfile 4. Activate the swap file # mkswap /var/cache/swap/swapfile 5. Verify the swapfile using 'free -m' or 'swapon -s' # swapon -s 6. Add the swap partition to fstab to make the swap file presistant across reboots # echo "/var/cache/swap/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab 7. To ensure you can reboot correctly, test the swap file by disabling it, then enabling it # swapoff /var/c...