How to measure DNS latency in Linux with tcpdump

In this case I was trying to identify which DNS resolver would be the best for my infrastructe in remote sites. Usually configuring 8.8.8.8 would be ok, yes is simple, but there are a couple of things going on in the background that deserves some checking if you want to achieve best performance. Which was my case since we have high perfomance robots in the remote sites infrastructure. So the first step is to measure right? If you don’t measure you don’t know if you are improving or even what to improve. ...

August 14, 2023 · 5 min · 917 words · Adrian Giacometti

How to set up 2 network isolated Docker containers (front and back-end)

Making this work might sound crazy, but if Docker has to be comparable in functionalities already provided by other types of virtualization, then this has to work right? Ok, this is the scenario, is a classic one: I need to deploy in one Docker host, 2 isolated containers, let’s say front-end and back-end. The Linux host will have 2 NICs, each one with a different subnet. Each container will use a different NIC and external subnet. For Docker this means 2 docker networks (fe-bridge and be-bridge), which translates to 2 Linux bridges. Traffic between containers is not allowed internally, it has to go to the external network where there is a Firewall. External management traffic will go directly to the containers but each one through its respective physical NIC. And of course, everything is connected to Internet. ...

August 6, 2021 · 9 min · 1907 words · Adrian Giacometti

How to configure 1 Linux host with 2 NICs and 2 Default Gateways

Historically, it was not possible to have 2 default gateways in a Linux host. You can SEND traffic to both NICs, but the reply will always come from the NIC which has the default gateway. This will generate asymmetric traffic and it will be denied in the network or by the originating host. Asymmetric traffic means that the packets will go back using a different path. In this case by ping to NIC1 the return will be sent by NIC2. ...

August 5, 2021 · 3 min · 460 words · Adrian Giacometti

The power of simplicity applied to monitoring

Some time ago I was asked for help to develop a “simple and quick” Python script to monitor the status of a Linux service. They were in the middle of a deployment and they needed something fast. They added, keep the result in a JSON file with the date, serve the directory with HTTP for quick view, and finally post it to ELK for graphics. Ok, this looks simple part by part, but the sum ends up in a very complete solution at the same time! ...

July 26, 2021 · 2 min · 389 words · Adrian Giacometti