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.35 on it. ...

May 26, 2018 · 1 min

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 · 1 min

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 · 1 min

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. By “cpu id”, I mean the first word of cpu* lines in /proc/stat . So cpu, cpu0, cpu1, etc. Here is a sample content of my /proc/stat file: ...

April 13, 2017 · 2 min

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. For Linux images, you need to name the directory linux-something, e.g. linux-ubuntu-14.04.5-amd64. You can find the list of supported image “types” in /opt/unetlab/html/templates. The names of the files are the prefixes needed for directory names. If you want to, you can edit those files to change the default parameters of the images (make a backup before you change anything). ...

March 18, 2016 · 4 min

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 · 1 min

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 · 2 min

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.symvers . $ cp /lib/modules/$(uname -r)/kernel/drivers/usb/serial/ch341.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial/ch341.ko.orig $ cd drivers/usb/serial $ cp ch341.c ch341.c.orig $ wget https://github.com/karlp/ch341-linux/raw/master/0001-usb-serial-ch341-Add-parity-support.patch $ cat 0001-usb-serial-ch341-Add-parity-support.patch | patch -p4 patching file ch341.c Hunk #1 succeeded at 349 (offset 3 lines). Hunk #2 succeeded at 370 (offset 3 lines). $ make -C /lib/modules/$(uname -r)/build M=$(pwd) modules $ sudo cp ch341.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial/ch341.ko $ sudo rmmod ch341 $ sudo modprobe ch341 Source for instructions: http://askubuntu.com/questions/515407/how-recipe-to-build-only-one-kernel-module ...

December 31, 2015 · 1 min

Update GNS3 server on GNS3 IOU VM

GNS3 Sourceforge account provides an OVA image ready to run gns3-server for those who want to use Cisco IOS on Unix images . However, at the time of this writing, the gns3-server version is outdated (1.3.3). The client must have the same version as the server to be able to connect to it. Here is how you can update the gns3-server inside the image. Note that you need Internet access for the update. ...

September 29, 2015 · 1 min

Migrate Debian 6+ to another server with minimal downtime

Recently I had to migrate services from a running Debian server to another one, with minimal downtime of services. I usually do this to P2V or V2V Linux systems, as this allows me to resize the new virtual machine to meet the services requirements (adjust disk size, inodes, partitionning, etc.). I have done this several times in the past on systems with Grub 1 but this is the first time with Grub 2, so I thought I’d share my process. ...

March 13, 2015 · 4 min