• How to setup L2TP over IPSec VPN server (Ubuntu 16.04 – 20.04)

    How to setup L2TP over IPSec VPN server (Ubuntu 16.04)

    # (optional, need to check ) apt-get install ppp libgmp3-dev bison flex

    Edit /etc/ipsec.conf

    Edit /etc/ipsec.secrets

    Edit /etc/ppp/options.xl2tpd

    Edit /etc/xl2tpd/xl2tpd.conf

    And finally add password to the /etc/ppp/chap-secrets file

    Everything should work fine!

    Upd. 2022.01


  • ubuntu git install and tips

    # update packages

    # install gitolite server

    # rename (not necessary) user gitolite3 to git

    # clone git admin dir to your home account

    # make changes in gitolite.conf — add new repo

    # show status

    # add files to repo

    # commit your changes

    # for use simple git push

    # push changes to repo

    All done, your repo is ready.

    Now go to dir with your app.

    # initialize dir for git

    # add url of «remote» repo

    # check it

    # commit and push your repo

    # clone repo on desktop


  • kvm live backup

    Live backup of your VM running in KVM under Ubuntu using qcow2 disk images

    # First of all disable apparmor to allow access

    # View disks

    # Suspend the domain (This is optional. I do this so that the condition of virtual machines remains unchanged during the backup.)

    # Create snapshot

    # or

    # View snapshots

    # View disks (it must be running on snapshots)

    # Copy drives to backup dir

    # Perform active blockcommit by live merging contents

    # View disks (it must be running on normal drives)

    # Unsuspend the domain

    # View snapshots again

    # Delete snapshots

    # View snapshots to check

    # Delete snapshot files


  • Installing PostgreSQL BDR

    Install PostgreSQL BDR

    For those who get the error:


    The following packages have unmet dependencies:
    postgresql-bdr-9.4: Depends: postgresql-bdr-client-9.4 but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.


    The following packages have unmet dependencies:
    postgresql-bdr-client-9.4: Depends: libpq5 (>= 9.4.4) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.

    That’s my solution based on https://wiki.postgresql.org/wiki/Apt and http://packages.2ndquadrant.com/bdr/apt/


  • Building an LXC Server

    Building an LXC Server on Ubuntu with ZFS and a container with public IP address

    First update Ubuntu

    Setup ZFS

    Configure LXC

    Configure ZFS

    Create ZFS pool:

    Keep in mind that deduplication takes much more memory and sometimes CPU.

    The rule of Thumb says to have 1GB of Ram per TB of Data. For deduplicated ZPools you actually should have 5 GB of Ram for 1TB of Data. I don’t use it.

    Turn on compression and create fs:

    To configure LXC to use ZFS as the backing store and set the default LXC path, add the following to /etc/lxc/lxc.conf:

    Creating a Container

    Create the first container by doing:

    Setup Bridged Network

    Important Commands

    Show bridge interfaces:

    Simple Bridge

    This setup can be used to connect multiple network interfaces. The bridge acts as a switch: each additional network interface is directly connected to the physical network.

    Edit /etc/network/interfaces, remove eth0, add br0.

    For dynamic IP:

    For static IP:

    reboot server

    Is all OK?

    Edit /tank/lxc/containers/node.name/config

    start the node:

    connect to the node:

    On the lxc node /etc/network/interfaces:

    It’s possible to use static IP address in node config and use dhcp inside the node, that works too.

    But IPv6 didn’t work inside the node, I disabled it and then the node stopped receiving IP address at all.

    I had to use static IP.

    I’m going to solve this problem later.