IPsec tunnel between Ubuntu 20.04 and Mikrotik router using strongSwan

Here is how to establish an IPsec tunnel between an Ubuntu 20.04 host and a Mikrotik router using IKEv2. The 2 endpoints of the tunnel are: ubuntu.xentoo.info : the Ubuntu server. This server has a local private subnet 10.0.0.0/24 and a fixed public IPv4 address 1.2.3.4 . The hostname ubuntu.xentoo.info resolves to the public IP address. mikrotik.xentoo.info : the Mikrotik router. This router has a local private subnet 192.168.0.0/24 and a dynamic public IPv4 address....

March 6, 2021

Install Firely III on Ubuntu 19.04

“Firefly III” is a (self-hosted) manager for your personal finances. You can find more about it on the following sites: https://github.com/firefly-iii/firefly-iii https://docs.firefly-iii.org/ Install prerequisites Let’s first install the requirements to run Firefly. Firefly documentation says it runs on PHP 7.2 but that’s wrong, it needs >=7.3 . Unfortunately, Ubuntu 19.04 comes with PHP 7.2 by default, so we need to use a PPA to have a more recent version. ondrej/php PPA has version 7....

January 5, 2020

Using a Mikrotik router with Tango Fiber (Luxembourg)

Hi guys, I moved to Luxembourg and I have opted for Tango Fiber. Their router is a Fritz!box which I do not like at all. I have a spare Mikrotik router, so here is how to configure. Tango Fiber uses PPPoE over VLAN 35, MTU is 1480. You need to ask the PPP credentials via a contact form on the website, they will answer within a few days. I have decided to use ether1 to connect the Fiber and create a VLAN interface named ether1....

May 26, 2018

Compile pjsip with pjsua on Ubuntu 16.04

As a personal note to myself :-) apt-get install make gcc pkg-config libasound2-dev wget http://www.pjsip.org/release/2.6/pjproject-2.6.tar.bz2 tar -xjf pjproject-2.6.tar.bz2 cd pjproject ./configure && make dep && make sudo make install sudo cp pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu /usr/local/bin/pjsua That’s it!

May 4, 2017

Extend snmpd to add detailed CPU statistics, per CPU (again)

For easier use with Cacti, it is easier to group statistics per type instead of per CPU. So you would have a parent OID for CPU time spent by user with many values (one per CPU). Put the following in /etc/snmp/percpudetail: #!/bin/bash case "$1" in "user") grep ^cpu /proc/stat | awk '{print 2}' ;; "nice") grep ^cpu /proc/stat | awk '{print 3}' ;; "system") grep ^cpu /proc/stat | awk '{print 4}' ;; "idle") grep ^cpu /proc/stat | awk '{print 5}' ;; "iowait") grep ^cpu /proc/stat | awk '{print 6}' ;; "irq") grep ^cpu /proc/stat | awk '{print 7}' ;; "softirq") grep ^cpu /proc/stat | awk '{print 8}' ;; esac Make it executable:...

April 14, 2017

Extend snmpd to add detailed CPU statistics, per cpu

I needed to export detailed CPU statistics from Linux servers using SNMP. While UCD-SNMP-MIB export some detailed stats, it only does it for the whole system. I may have missed something easier though :-) So here is a BASH script, put it in /etc/snmp/percpustats: #!/bin/bash /bin/grep "^$1 " /proc/stat | sed -e 's/^cpu[0-9]* *//' | tr ' ' '\n' Make it executable: chmod +x /etc/snmp/percpustats This simple script takes a single argument, which is the cpu id you want to look at....

April 13, 2017

Unetlab: create a QEMU image

So you have your Unified Networking Lab (UNL) server running and you want to use arbitrary QEMU images with it. Here is how to create one. All UNL data is stored under /opt/unetlab , images are stored under /opt/unetlab/addons and QEMU images are a folder deeper under /opt/unetlab/addons/qemu . UNL expects to find images within directories named according to some scheme. The directory names must start with some keywords followed by anything you want....

March 18, 2016

Cisco IOS PPTP server : PPP: Packet throttled, Dropping packet

If you get the following message on your Cisco router when you connect a VPN client using PPTP *Mar 17 16:43:02.371: Vi5 PPP: Control packet rate limit 10 reached *Mar 17 16:43:02.371: Vi5 PPP: Entering block state for 30 seconds *Mar 17 16:43:02.371: Vi5 PPP: Packet throttled, Dropping packet Then it means you have an IOS version which greatly reduced the allowed rate of PPP control packets before it triggers a block....

March 18, 2016

Microsoft Windows 7 PPTP issues: spurious ICMP protocol-unreachable sent

I was recently confronted to a strange issue with a PPTP VPN connection to a central site. Some users could connect and some others could not. They all used Windows 7 with SP1, configured the same way, and all computers were behind NAT/PAT routers but not necessarily on the same site. On the VPN server, the only information I could get was this log stating the GRE protocol was unreachable:...

February 23, 2016

Ubuntu 14.04 and USB to Serial ch341 (chinese device from Ebay)

You can find pretty cheap USB to Serial devices on Ebay. I bought one and received a device using a chip ch341. Unfortunately, the drive is bugged in Ubuntu 12.04 and 14.04. Fortunately, there is patch to fix it. Here is how to recompile the module to enjoy these devices. $ sudo apt-get source linux-source-3.13.0 linux-headers-$(uname -r) $ cd /tmp $ tar -xjf /usr/src/linux-source-3.13.0.tar.bz2 $ cd linux-source-3.13.0/ $ make oldconfig $ make prepare $ make scripts $ cp -v /usr/src/linux-headers-$(uname -r)/Module....

December 31, 2015