Show neutron router namespaces by floating IP (FIP)

# search in floating IP table
ROUTER_ID=$(openstack floating ip list --floating-ip-address ${FLOATING_IP} --long -c Router -f value)
if [ -z ${ROUTER_ID} ]; then
    # search in router
    ROUTER_ID=$(openstack router list --long | grep ${FLOATING_IP} | cut -d" " -f2)
PROJECT_ID=$(openstack router show ${ROUTER_ID} -c project_id -f value)
echo -e "\e[34m# Project"
openstack router show ${ROUTER_ID} -c id -c name 
echo -e "\e[34m# Router"
openstack project show ${PROJECT_ID} -c id -c name -c description
echo -e "\e[34m# Router namespaces"
openstack network agent list --router ${ROUTER_ID} --long --sort-column 'HA State'

Install Home Assistant on Raspberry Pi

Install Home Assistant on Raspberry Pi

# Install rpi-imager
sudo apt install rpi-imager
# Create Homeassistant SD-Card
# Other specific-purpose OS > Home assistants and home Automation > Home Assistant OS
# Connect to HA
# Create Home Assistant account
# Install SSH plugin in Add-on-Store
# Open SSH Web CLI
# get wifi data from workstation
WIFI_SSID="$(nmcli dev wifi show-password | grep SSID | cut -d' ' -f2-)" 
WIFI_PASS="$(nmcli dev wifi show-password | grep Pass | cut -d' ' -f2-)"
echo ha network update wlan0 \
  --ipv4-method auto \
  --wifi-auth wpa-psk \
  --wifi-mode infrastructure \
  --wifi-ssid \'${WIFI_SSID}\' \
  --wifi-psk \'${WIFI_PASS}\'
# paste output to SSH online console 
# debug
ha network info

Enable SSH key to hypervisor (Raspberry Pi)

Raspberry Pi


# Raspbian (Debian Jessie)
sudo umount /dev/mmcblk0*
wget -q -P /tmp
unzip -p /home/pako/Downloads/ | sudo dd of=/dev/mmcblk0

wget -q -P /tmp

View used codecs
for codec in H264 MPG2 WVC1 MPG4 MJPG WMV9 ; do \

Install minikube

Install docker

Install minikube

curl -LO$(dpkg --print-architecture).deb
sudo dpkg -i minikube_latest_*.deb
rm minikube_latest_*.deb
sudo usermod -aG docker $USER && newgrp docker
minikube start
minikube addons enable ingress

Install kubectl

Deploy kubernetes cluster with kubeadm

Prepare VM for Container Runtime

# run on all nodes
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
sudo modprobe overlay
sudo modprobe br_netfilter
# sysctl params required by setup, params persist across reboots
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables  = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward                 = 1
sudo sysctl --system
# Verify
lsmod | grep br_netfilter
lsmod | grep overlay
sysctl net.bridge.bridge-nf-call-iptables net.bridge.bridge-nf-call-ip6tables net.ipv4.ip_forward

Install containerd

Docker networking

docker network ls
docker network inspect bridge
docker network inspect host
docker network inspect none
ip addr show docker0
ip link show docker0
ip -c link show type bridge
ip netns
docker inspect ${DOCKER_ID}
ip link # attached to bridge
# vethxxx@ifx
ip -n ${INTERFACE_ID} # assignet do container
# eth0@ifx
ip -n ${NAMESPACE_ID} addr
docker run -p 8080:80 nginx # forward internal port 80 to host port 8080
#iptables -t nat -A PREROUTING -j DNAT --dport 8080 -to-destination 80
#iptables -t nat -A Docker -j DNAT --dport 8080 --to-destination
iptables -nvL -t nat

Terraform: OpenStack

OpenStack Providery

# Configure the OpenStack Provider
provider "openstack" {
  user_name   = "admin"
  tenant_name = "admin"
  password    = "pwd"
  auth_url    = "http://myauthurl:5000/v2.0"
  region      = "RegionOne"
# cloud.yaml
provider "openstack" {
  cloud      = "dev-foo"


resource "openstack_networking_router_v2" "router_1" {
  name       = "foo-router"
  external_network_id = "88934cac-8d55-40d5-8ff9-bde65011741d"
resource "openstack_networking_router_interface_v2" "terraform" {
  router_id =
  subnet_id =


resource "openstack_compute_instance_v2" "basic" {
  name            = "basic"
  image_id        = "ad091b52-742f-469e-8f3c-fd81cadf0743"
  flavor_id       = "3"
  key_pair        = "my_key_pair_name"
  security_groups = ["default"]
  metadata = {
    this = "that"
  network {
    name = "my_network"